DescribeBindersResult.cc 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  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/cloudesl/model/DescribeBindersResult.h>
  17. #include <json/json.h>
  18. using namespace AlibabaCloud::Cloudesl;
  19. using namespace AlibabaCloud::Cloudesl::Model;
  20. DescribeBindersResult::DescribeBindersResult() :
  21. ServiceResult()
  22. {}
  23. DescribeBindersResult::DescribeBindersResult(const std::string &payload) :
  24. ServiceResult()
  25. {
  26. parse(payload);
  27. }
  28. DescribeBindersResult::~DescribeBindersResult()
  29. {}
  30. void DescribeBindersResult::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 allEslItemBindInfosNode = value["EslItemBindInfos"]["EslItemBindInfo"];
  37. for (auto valueEslItemBindInfosEslItemBindInfo : allEslItemBindInfosNode)
  38. {
  39. EslItemBindInfo eslItemBindInfosObject;
  40. if(!valueEslItemBindInfosEslItemBindInfo["PromotionText"].isNull())
  41. eslItemBindInfosObject.promotionText = valueEslItemBindInfosEslItemBindInfo["PromotionText"].asString();
  42. if(!valueEslItemBindInfosEslItemBindInfo["BindId"].isNull())
  43. eslItemBindInfosObject.bindId = valueEslItemBindInfosEslItemBindInfo["BindId"].asString();
  44. if(!valueEslItemBindInfosEslItemBindInfo["StoreId"].isNull())
  45. eslItemBindInfosObject.storeId = valueEslItemBindInfosEslItemBindInfo["StoreId"].asString();
  46. if(!valueEslItemBindInfosEslItemBindInfo["TemplateId"].isNull())
  47. eslItemBindInfosObject.templateId = valueEslItemBindInfosEslItemBindInfo["TemplateId"].asString();
  48. if(!valueEslItemBindInfosEslItemBindInfo["EslPic"].isNull())
  49. eslItemBindInfosObject.eslPic = valueEslItemBindInfosEslItemBindInfo["EslPic"].asString();
  50. if(!valueEslItemBindInfosEslItemBindInfo["EslStatus"].isNull())
  51. eslItemBindInfosObject.eslStatus = valueEslItemBindInfosEslItemBindInfo["EslStatus"].asString();
  52. if(!valueEslItemBindInfosEslItemBindInfo["ItemTitle"].isNull())
  53. eslItemBindInfosObject.itemTitle = valueEslItemBindInfosEslItemBindInfo["ItemTitle"].asString();
  54. if(!valueEslItemBindInfosEslItemBindInfo["OriginalPrice"].isNull())
  55. eslItemBindInfosObject.originalPrice = valueEslItemBindInfosEslItemBindInfo["OriginalPrice"].asString();
  56. if(!valueEslItemBindInfosEslItemBindInfo["TemplateSceneId"].isNull())
  57. eslItemBindInfosObject.templateSceneId = valueEslItemBindInfosEslItemBindInfo["TemplateSceneId"].asString();
  58. if(!valueEslItemBindInfosEslItemBindInfo["GmtModified"].isNull())
  59. eslItemBindInfosObject.gmtModified = valueEslItemBindInfosEslItemBindInfo["GmtModified"].asString();
  60. if(!valueEslItemBindInfosEslItemBindInfo["ActionPrice"].isNull())
  61. eslItemBindInfosObject.actionPrice = valueEslItemBindInfosEslItemBindInfo["ActionPrice"].asString();
  62. if(!valueEslItemBindInfosEslItemBindInfo["PriceUnit"].isNull())
  63. eslItemBindInfosObject.priceUnit = valueEslItemBindInfosEslItemBindInfo["PriceUnit"].asString();
  64. if(!valueEslItemBindInfosEslItemBindInfo["EslConnectAp"].isNull())
  65. eslItemBindInfosObject.eslConnectAp = valueEslItemBindInfosEslItemBindInfo["EslConnectAp"].asString();
  66. if(!valueEslItemBindInfosEslItemBindInfo["SkuId"].isNull())
  67. eslItemBindInfosObject.skuId = valueEslItemBindInfosEslItemBindInfo["SkuId"].asString();
  68. if(!valueEslItemBindInfosEslItemBindInfo["EslBarCode"].isNull())
  69. eslItemBindInfosObject.eslBarCode = valueEslItemBindInfosEslItemBindInfo["EslBarCode"].asString();
  70. if(!valueEslItemBindInfosEslItemBindInfo["ItemShortTitle"].isNull())
  71. eslItemBindInfosObject.itemShortTitle = valueEslItemBindInfosEslItemBindInfo["ItemShortTitle"].asString();
  72. if(!valueEslItemBindInfosEslItemBindInfo["BePromotion"].isNull())
  73. eslItemBindInfosObject.bePromotion = valueEslItemBindInfosEslItemBindInfo["BePromotion"].asString() == "true";
  74. if(!valueEslItemBindInfosEslItemBindInfo["EslModel"].isNull())
  75. eslItemBindInfosObject.eslModel = valueEslItemBindInfosEslItemBindInfo["EslModel"].asString();
  76. if(!valueEslItemBindInfosEslItemBindInfo["ItemBarCode"].isNull())
  77. eslItemBindInfosObject.itemBarCode = valueEslItemBindInfosEslItemBindInfo["ItemBarCode"].asString();
  78. if(!valueEslItemBindInfosEslItemBindInfo["ItemId"].isNull())
  79. eslItemBindInfosObject.itemId = valueEslItemBindInfosEslItemBindInfo["ItemId"].asString();
  80. if(!valueEslItemBindInfosEslItemBindInfo["PromotionStart"].isNull())
  81. eslItemBindInfosObject.promotionStart = valueEslItemBindInfosEslItemBindInfo["PromotionStart"].asString();
  82. if(!valueEslItemBindInfosEslItemBindInfo["PromotionEnd"].isNull())
  83. eslItemBindInfosObject.promotionEnd = valueEslItemBindInfosEslItemBindInfo["PromotionEnd"].asString();
  84. eslItemBindInfos_.push_back(eslItemBindInfosObject);
  85. }
  86. if(!value["ErrorMessage"].isNull())
  87. errorMessage_ = value["ErrorMessage"].asString();
  88. if(!value["ErrorCode"].isNull())
  89. errorCode_ = value["ErrorCode"].asString();
  90. if(!value["TotalCount"].isNull())
  91. totalCount_ = std::stoi(value["TotalCount"].asString());
  92. if(!value["Message"].isNull())
  93. message_ = value["Message"].asString();
  94. if(!value["PageSize"].isNull())
  95. pageSize_ = std::stoi(value["PageSize"].asString());
  96. if(!value["DynamicCode"].isNull())
  97. dynamicCode_ = value["DynamicCode"].asString();
  98. if(!value["Code"].isNull())
  99. code_ = value["Code"].asString();
  100. if(!value["DynamicMessage"].isNull())
  101. dynamicMessage_ = value["DynamicMessage"].asString();
  102. if(!value["PageNumber"].isNull())
  103. pageNumber_ = std::stoi(value["PageNumber"].asString());
  104. if(!value["Success"].isNull())
  105. success_ = value["Success"].asString() == "true";
  106. }
  107. int DescribeBindersResult::getTotalCount()const
  108. {
  109. return totalCount_;
  110. }
  111. std::string DescribeBindersResult::getMessage()const
  112. {
  113. return message_;
  114. }
  115. int DescribeBindersResult::getPageSize()const
  116. {
  117. return pageSize_;
  118. }
  119. int DescribeBindersResult::getPageNumber()const
  120. {
  121. return pageNumber_;
  122. }
  123. std::string DescribeBindersResult::getDynamicCode()const
  124. {
  125. return dynamicCode_;
  126. }
  127. std::string DescribeBindersResult::getErrorCode()const
  128. {
  129. return errorCode_;
  130. }
  131. std::string DescribeBindersResult::getDynamicMessage()const
  132. {
  133. return dynamicMessage_;
  134. }
  135. std::string DescribeBindersResult::getErrorMessage()const
  136. {
  137. return errorMessage_;
  138. }
  139. std::string DescribeBindersResult::getCode()const
  140. {
  141. return code_;
  142. }
  143. bool DescribeBindersResult::getSuccess()const
  144. {
  145. return success_;
  146. }
  147. std::vector<DescribeBindersResult::EslItemBindInfo> DescribeBindersResult::getEslItemBindInfos()const
  148. {
  149. return eslItemBindInfos_;
  150. }