DescribeFlowJobResult.cc 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  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/emr/model/DescribeFlowJobResult.h>
  17. #include <json/json.h>
  18. using namespace AlibabaCloud::Emr;
  19. using namespace AlibabaCloud::Emr::Model;
  20. DescribeFlowJobResult::DescribeFlowJobResult() :
  21. ServiceResult()
  22. {}
  23. DescribeFlowJobResult::DescribeFlowJobResult(const std::string &payload) :
  24. ServiceResult()
  25. {
  26. parse(payload);
  27. }
  28. DescribeFlowJobResult::~DescribeFlowJobResult()
  29. {}
  30. void DescribeFlowJobResult::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 allResourceListNode = value["ResourceList"]["Resource"];
  37. for (auto valueResourceListResource : allResourceListNode)
  38. {
  39. Resource resourceListObject;
  40. if(!valueResourceListResource["Path"].isNull())
  41. resourceListObject.path = valueResourceListResource["Path"].asString();
  42. if(!valueResourceListResource["Alias"].isNull())
  43. resourceListObject.alias = valueResourceListResource["Alias"].asString();
  44. resourceList_.push_back(resourceListObject);
  45. }
  46. if(!value["Id"].isNull())
  47. id_ = value["Id"].asString();
  48. if(!value["GmtCreate"].isNull())
  49. gmtCreate_ = std::stol(value["GmtCreate"].asString());
  50. if(!value["GmtModified"].isNull())
  51. gmtModified_ = std::stol(value["GmtModified"].asString());
  52. if(!value["Name"].isNull())
  53. name_ = value["Name"].asString();
  54. if(!value["Type"].isNull())
  55. type_ = value["Type"].asString();
  56. if(!value["Description"].isNull())
  57. description_ = value["Description"].asString();
  58. if(!value["FailAct"].isNull())
  59. failAct_ = value["FailAct"].asString();
  60. if(!value["MaxRetry"].isNull())
  61. maxRetry_ = std::stoi(value["MaxRetry"].asString());
  62. if(!value["RetryInterval"].isNull())
  63. retryInterval_ = std::stol(value["RetryInterval"].asString());
  64. if(!value["Params"].isNull())
  65. params_ = value["Params"].asString();
  66. if(!value["ParamConf"].isNull())
  67. paramConf_ = value["ParamConf"].asString();
  68. if(!value["CustomVariables"].isNull())
  69. customVariables_ = value["CustomVariables"].asString();
  70. if(!value["EnvConf"].isNull())
  71. envConf_ = value["EnvConf"].asString();
  72. if(!value["RunConf"].isNull())
  73. runConf_ = value["RunConf"].asString();
  74. if(!value["MonitorConf"].isNull())
  75. monitorConf_ = value["MonitorConf"].asString();
  76. if(!value["CategoryId"].isNull())
  77. categoryId_ = value["CategoryId"].asString();
  78. if(!value["mode"].isNull())
  79. mode_ = value["mode"].asString();
  80. if(!value["LastInstanceId"].isNull())
  81. lastInstanceId_ = value["LastInstanceId"].asString();
  82. if(!value["Adhoc"].isNull())
  83. adhoc_ = value["Adhoc"].asString();
  84. if(!value["AlertConf"].isNull())
  85. alertConf_ = value["AlertConf"].asString();
  86. if(!value["EditLockDetail"].isNull())
  87. editLockDetail_ = value["EditLockDetail"].asString();
  88. if(!value["MaxRunningTimeSec"].isNull())
  89. maxRunningTimeSec_ = std::stol(value["MaxRunningTimeSec"].asString());
  90. }
  91. std::string DescribeFlowJobResult::getFailAct()const
  92. {
  93. return failAct_;
  94. }
  95. std::string DescribeFlowJobResult::getCategoryId()const
  96. {
  97. return categoryId_;
  98. }
  99. std::string DescribeFlowJobResult::getDescription()const
  100. {
  101. return description_;
  102. }
  103. std::string DescribeFlowJobResult::getMode()const
  104. {
  105. return mode_;
  106. }
  107. std::string DescribeFlowJobResult::getLastInstanceId()const
  108. {
  109. return lastInstanceId_;
  110. }
  111. long DescribeFlowJobResult::getGmtModified()const
  112. {
  113. return gmtModified_;
  114. }
  115. std::string DescribeFlowJobResult::getParams()const
  116. {
  117. return params_;
  118. }
  119. int DescribeFlowJobResult::getMaxRetry()const
  120. {
  121. return maxRetry_;
  122. }
  123. std::string DescribeFlowJobResult::getEditLockDetail()const
  124. {
  125. return editLockDetail_;
  126. }
  127. long DescribeFlowJobResult::getMaxRunningTimeSec()const
  128. {
  129. return maxRunningTimeSec_;
  130. }
  131. std::string DescribeFlowJobResult::getName()const
  132. {
  133. return name_;
  134. }
  135. std::string DescribeFlowJobResult::getParamConf()const
  136. {
  137. return paramConf_;
  138. }
  139. std::vector<DescribeFlowJobResult::Resource> DescribeFlowJobResult::getResourceList()const
  140. {
  141. return resourceList_;
  142. }
  143. long DescribeFlowJobResult::getGmtCreate()const
  144. {
  145. return gmtCreate_;
  146. }
  147. std::string DescribeFlowJobResult::getType()const
  148. {
  149. return type_;
  150. }
  151. std::string DescribeFlowJobResult::getEnvConf()const
  152. {
  153. return envConf_;
  154. }
  155. std::string DescribeFlowJobResult::getMonitorConf()const
  156. {
  157. return monitorConf_;
  158. }
  159. std::string DescribeFlowJobResult::getAdhoc()const
  160. {
  161. return adhoc_;
  162. }
  163. std::string DescribeFlowJobResult::getId()const
  164. {
  165. return id_;
  166. }
  167. long DescribeFlowJobResult::getRetryInterval()const
  168. {
  169. return retryInterval_;
  170. }
  171. std::string DescribeFlowJobResult::getRunConf()const
  172. {
  173. return runConf_;
  174. }
  175. std::string DescribeFlowJobResult::getCustomVariables()const
  176. {
  177. return customVariables_;
  178. }
  179. std::string DescribeFlowJobResult::getAlertConf()const
  180. {
  181. return alertConf_;
  182. }