DescribeHealthCheckAttributeResult.cc 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  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/smartag/model/DescribeHealthCheckAttributeResult.h>
  17. #include <json/json.h>
  18. using namespace AlibabaCloud::Smartag;
  19. using namespace AlibabaCloud::Smartag::Model;
  20. DescribeHealthCheckAttributeResult::DescribeHealthCheckAttributeResult() :
  21. ServiceResult()
  22. {}
  23. DescribeHealthCheckAttributeResult::DescribeHealthCheckAttributeResult(const std::string &payload) :
  24. ServiceResult()
  25. {
  26. parse(payload);
  27. }
  28. DescribeHealthCheckAttributeResult::~DescribeHealthCheckAttributeResult()
  29. {}
  30. void DescribeHealthCheckAttributeResult::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. if(!value["CreateTime"].isNull())
  37. createTime_ = std::stol(value["CreateTime"].asString());
  38. if(!value["HcInstanceId"].isNull())
  39. hcInstanceId_ = value["HcInstanceId"].asString();
  40. if(!value["SmartAGId"].isNull())
  41. smartAGId_ = value["SmartAGId"].asString();
  42. if(!value["Name"].isNull())
  43. name_ = value["Name"].asString();
  44. if(!value["Description"].isNull())
  45. description_ = value["Description"].asString();
  46. if(!value["Type"].isNull())
  47. type_ = value["Type"].asString();
  48. if(!value["DstIpAddr"].isNull())
  49. dstIpAddr_ = value["DstIpAddr"].asString();
  50. if(!value["DstPort"].isNull())
  51. dstPort_ = std::stoi(value["DstPort"].asString());
  52. if(!value["SrcIpAddr"].isNull())
  53. srcIpAddr_ = value["SrcIpAddr"].asString();
  54. if(!value["SrcPort"].isNull())
  55. srcPort_ = std::stoi(value["SrcPort"].asString());
  56. if(!value["ProbeInterval"].isNull())
  57. probeInterval_ = std::stoi(value["ProbeInterval"].asString());
  58. if(!value["ProbeCount"].isNull())
  59. probeCount_ = std::stoi(value["ProbeCount"].asString());
  60. if(!value["ProbeTimeout"].isNull())
  61. probeTimeout_ = std::stoi(value["ProbeTimeout"].asString());
  62. if(!value["RttThreshold"].isNull())
  63. rttThreshold_ = std::stoi(value["RttThreshold"].asString());
  64. if(!value["RttFailThreshold"].isNull())
  65. rttFailThreshold_ = std::stoi(value["RttFailThreshold"].asString());
  66. if(!value["FailCountThreshold"].isNull())
  67. failCountThreshold_ = std::stoi(value["FailCountThreshold"].asString());
  68. }
  69. std::string DescribeHealthCheckAttributeResult::getDescription()const
  70. {
  71. return description_;
  72. }
  73. int DescribeHealthCheckAttributeResult::getSrcPort()const
  74. {
  75. return srcPort_;
  76. }
  77. std::string DescribeHealthCheckAttributeResult::getSrcIpAddr()const
  78. {
  79. return srcIpAddr_;
  80. }
  81. long DescribeHealthCheckAttributeResult::getCreateTime()const
  82. {
  83. return createTime_;
  84. }
  85. int DescribeHealthCheckAttributeResult::getFailCountThreshold()const
  86. {
  87. return failCountThreshold_;
  88. }
  89. int DescribeHealthCheckAttributeResult::getDstPort()const
  90. {
  91. return dstPort_;
  92. }
  93. std::string DescribeHealthCheckAttributeResult::getName()const
  94. {
  95. return name_;
  96. }
  97. int DescribeHealthCheckAttributeResult::getProbeCount()const
  98. {
  99. return probeCount_;
  100. }
  101. std::string DescribeHealthCheckAttributeResult::getType()const
  102. {
  103. return type_;
  104. }
  105. int DescribeHealthCheckAttributeResult::getProbeTimeout()const
  106. {
  107. return probeTimeout_;
  108. }
  109. std::string DescribeHealthCheckAttributeResult::getHcInstanceId()const
  110. {
  111. return hcInstanceId_;
  112. }
  113. int DescribeHealthCheckAttributeResult::getRttThreshold()const
  114. {
  115. return rttThreshold_;
  116. }
  117. int DescribeHealthCheckAttributeResult::getProbeInterval()const
  118. {
  119. return probeInterval_;
  120. }
  121. std::string DescribeHealthCheckAttributeResult::getSmartAGId()const
  122. {
  123. return smartAGId_;
  124. }
  125. int DescribeHealthCheckAttributeResult::getRttFailThreshold()const
  126. {
  127. return rttFailThreshold_;
  128. }
  129. std::string DescribeHealthCheckAttributeResult::getDstIpAddr()const
  130. {
  131. return dstIpAddr_;
  132. }