QuerySnapshotJobListResult.cc 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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/QuerySnapshotJobListResult.h>
  17. #include <json/json.h>
  18. using namespace AlibabaCloud::Mts;
  19. using namespace AlibabaCloud::Mts::Model;
  20. QuerySnapshotJobListResult::QuerySnapshotJobListResult() :
  21. ServiceResult()
  22. {}
  23. QuerySnapshotJobListResult::QuerySnapshotJobListResult(const std::string &payload) :
  24. ServiceResult()
  25. {
  26. parse(payload);
  27. }
  28. QuerySnapshotJobListResult::~QuerySnapshotJobListResult()
  29. {}
  30. void QuerySnapshotJobListResult::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 allSnapshotJobListNode = value["SnapshotJobList"]["SnapshotJob"];
  37. for (auto valueSnapshotJobListSnapshotJob : allSnapshotJobListNode)
  38. {
  39. SnapshotJob snapshotJobListObject;
  40. if(!valueSnapshotJobListSnapshotJob["Id"].isNull())
  41. snapshotJobListObject.id = valueSnapshotJobListSnapshotJob["Id"].asString();
  42. if(!valueSnapshotJobListSnapshotJob["UserData"].isNull())
  43. snapshotJobListObject.userData = valueSnapshotJobListSnapshotJob["UserData"].asString();
  44. if(!valueSnapshotJobListSnapshotJob["PipelineId"].isNull())
  45. snapshotJobListObject.pipelineId = valueSnapshotJobListSnapshotJob["PipelineId"].asString();
  46. if(!valueSnapshotJobListSnapshotJob["State"].isNull())
  47. snapshotJobListObject.state = valueSnapshotJobListSnapshotJob["State"].asString();
  48. if(!valueSnapshotJobListSnapshotJob["Code"].isNull())
  49. snapshotJobListObject.code = valueSnapshotJobListSnapshotJob["Code"].asString();
  50. if(!valueSnapshotJobListSnapshotJob["Count"].isNull())
  51. snapshotJobListObject.count = valueSnapshotJobListSnapshotJob["Count"].asString();
  52. if(!valueSnapshotJobListSnapshotJob["TileCount"].isNull())
  53. snapshotJobListObject.tileCount = valueSnapshotJobListSnapshotJob["TileCount"].asString();
  54. if(!valueSnapshotJobListSnapshotJob["Message"].isNull())
  55. snapshotJobListObject.message = valueSnapshotJobListSnapshotJob["Message"].asString();
  56. if(!valueSnapshotJobListSnapshotJob["CreationTime"].isNull())
  57. snapshotJobListObject.creationTime = valueSnapshotJobListSnapshotJob["CreationTime"].asString();
  58. auto inputNode = value["Input"];
  59. if(!inputNode["Bucket"].isNull())
  60. snapshotJobListObject.input.bucket = inputNode["Bucket"].asString();
  61. if(!inputNode["Location"].isNull())
  62. snapshotJobListObject.input.location = inputNode["Location"].asString();
  63. if(!inputNode["Object"].isNull())
  64. snapshotJobListObject.input.object = inputNode["Object"].asString();
  65. if(!inputNode["RoleArn"].isNull())
  66. snapshotJobListObject.input.roleArn = inputNode["RoleArn"].asString();
  67. auto snapshotConfigNode = value["SnapshotConfig"];
  68. if(!snapshotConfigNode["Time"].isNull())
  69. snapshotJobListObject.snapshotConfig.time = snapshotConfigNode["Time"].asString();
  70. if(!snapshotConfigNode["Interval"].isNull())
  71. snapshotJobListObject.snapshotConfig.interval = snapshotConfigNode["Interval"].asString();
  72. if(!snapshotConfigNode["Num"].isNull())
  73. snapshotJobListObject.snapshotConfig.num = snapshotConfigNode["Num"].asString();
  74. if(!snapshotConfigNode["Width"].isNull())
  75. snapshotJobListObject.snapshotConfig.width = snapshotConfigNode["Width"].asString();
  76. if(!snapshotConfigNode["Height"].isNull())
  77. snapshotJobListObject.snapshotConfig.height = snapshotConfigNode["Height"].asString();
  78. if(!snapshotConfigNode["FrameType"].isNull())
  79. snapshotJobListObject.snapshotConfig.frameType = snapshotConfigNode["FrameType"].asString();
  80. auto outputFileNode = snapshotConfigNode["OutputFile"];
  81. if(!outputFileNode["Bucket"].isNull())
  82. snapshotJobListObject.snapshotConfig.outputFile.bucket = outputFileNode["Bucket"].asString();
  83. if(!outputFileNode["Location"].isNull())
  84. snapshotJobListObject.snapshotConfig.outputFile.location = outputFileNode["Location"].asString();
  85. if(!outputFileNode["Object"].isNull())
  86. snapshotJobListObject.snapshotConfig.outputFile.object = outputFileNode["Object"].asString();
  87. if(!outputFileNode["RoleArn"].isNull())
  88. snapshotJobListObject.snapshotConfig.outputFile.roleArn = outputFileNode["RoleArn"].asString();
  89. auto tileOutputFileNode = snapshotConfigNode["TileOutputFile"];
  90. if(!tileOutputFileNode["Bucket"].isNull())
  91. snapshotJobListObject.snapshotConfig.tileOutputFile.bucket = tileOutputFileNode["Bucket"].asString();
  92. if(!tileOutputFileNode["Location"].isNull())
  93. snapshotJobListObject.snapshotConfig.tileOutputFile.location = tileOutputFileNode["Location"].asString();
  94. if(!tileOutputFileNode["Object"].isNull())
  95. snapshotJobListObject.snapshotConfig.tileOutputFile.object = tileOutputFileNode["Object"].asString();
  96. if(!tileOutputFileNode["RoleArn"].isNull())
  97. snapshotJobListObject.snapshotConfig.tileOutputFile.roleArn = tileOutputFileNode["RoleArn"].asString();
  98. auto tileOutNode = snapshotConfigNode["TileOut"];
  99. if(!tileOutNode["Lines"].isNull())
  100. snapshotJobListObject.snapshotConfig.tileOut.lines = tileOutNode["Lines"].asString();
  101. if(!tileOutNode["Columns"].isNull())
  102. snapshotJobListObject.snapshotConfig.tileOut.columns = tileOutNode["Columns"].asString();
  103. if(!tileOutNode["CellWidth"].isNull())
  104. snapshotJobListObject.snapshotConfig.tileOut.cellWidth = tileOutNode["CellWidth"].asString();
  105. if(!tileOutNode["CellHeight"].isNull())
  106. snapshotJobListObject.snapshotConfig.tileOut.cellHeight = tileOutNode["CellHeight"].asString();
  107. if(!tileOutNode["Margin"].isNull())
  108. snapshotJobListObject.snapshotConfig.tileOut.margin = tileOutNode["Margin"].asString();
  109. if(!tileOutNode["Padding"].isNull())
  110. snapshotJobListObject.snapshotConfig.tileOut.padding = tileOutNode["Padding"].asString();
  111. if(!tileOutNode["Color"].isNull())
  112. snapshotJobListObject.snapshotConfig.tileOut.color = tileOutNode["Color"].asString();
  113. if(!tileOutNode["IsKeepCellPic"].isNull())
  114. snapshotJobListObject.snapshotConfig.tileOut.isKeepCellPic = tileOutNode["IsKeepCellPic"].asString();
  115. if(!tileOutNode["CellSelStep"].isNull())
  116. snapshotJobListObject.snapshotConfig.tileOut.cellSelStep = tileOutNode["CellSelStep"].asString();
  117. auto mNSMessageResultNode = value["MNSMessageResult"];
  118. if(!mNSMessageResultNode["MessageId"].isNull())
  119. snapshotJobListObject.mNSMessageResult.messageId = mNSMessageResultNode["MessageId"].asString();
  120. if(!mNSMessageResultNode["ErrorMessage"].isNull())
  121. snapshotJobListObject.mNSMessageResult.errorMessage = mNSMessageResultNode["ErrorMessage"].asString();
  122. if(!mNSMessageResultNode["ErrorCode"].isNull())
  123. snapshotJobListObject.mNSMessageResult.errorCode = mNSMessageResultNode["ErrorCode"].asString();
  124. snapshotJobList_.push_back(snapshotJobListObject);
  125. }
  126. auto allNonExistSnapshotJobIds = value["NonExistSnapshotJobIds"]["String"];
  127. for (const auto &item : allNonExistSnapshotJobIds)
  128. nonExistSnapshotJobIds_.push_back(item.asString());
  129. if(!value["NextPageToken"].isNull())
  130. nextPageToken_ = value["NextPageToken"].asString();
  131. }
  132. std::vector<QuerySnapshotJobListResult::SnapshotJob> QuerySnapshotJobListResult::getSnapshotJobList()const
  133. {
  134. return snapshotJobList_;
  135. }
  136. std::vector<std::string> QuerySnapshotJobListResult::getNonExistSnapshotJobIds()const
  137. {
  138. return nonExistSnapshotJobIds_;
  139. }
  140. std::string QuerySnapshotJobListResult::getNextPageToken()const
  141. {
  142. return nextPageToken_;
  143. }