DescribeSignatureTradeListResult.cc 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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/cas/model/DescribeSignatureTradeListResult.h>
  17. #include <json/json.h>
  18. using namespace AlibabaCloud::Cas;
  19. using namespace AlibabaCloud::Cas::Model;
  20. DescribeSignatureTradeListResult::DescribeSignatureTradeListResult() :
  21. ServiceResult()
  22. {}
  23. DescribeSignatureTradeListResult::DescribeSignatureTradeListResult(const std::string &payload) :
  24. ServiceResult()
  25. {
  26. parse(payload);
  27. }
  28. DescribeSignatureTradeListResult::~DescribeSignatureTradeListResult()
  29. {}
  30. void DescribeSignatureTradeListResult::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 allTradeListNode = value["TradeList"]["trade"];
  37. for (auto valueTradeListtrade : allTradeListNode)
  38. {
  39. Trade tradeListObject;
  40. if(!valueTradeListtrade["Id"].isNull())
  41. tradeListObject.id = std::stol(valueTradeListtrade["Id"].asString());
  42. if(!valueTradeListtrade["DocTitle"].isNull())
  43. tradeListObject.docTitle = valueTradeListtrade["DocTitle"].asString();
  44. if(!valueTradeListtrade["TransactionId"].isNull())
  45. tradeListObject.transactionId = valueTradeListtrade["TransactionId"].asString();
  46. if(!valueTradeListtrade["PeopleName"].isNull())
  47. tradeListObject.peopleName = valueTradeListtrade["PeopleName"].asString();
  48. if(!valueTradeListtrade["CreateTime"].isNull())
  49. tradeListObject.createTime = std::stol(valueTradeListtrade["CreateTime"].asString());
  50. if(!valueTradeListtrade["SignStatus"].isNull())
  51. tradeListObject.signStatus = std::stoi(valueTradeListtrade["SignStatus"].asString());
  52. if(!valueTradeListtrade["SignMode"].isNull())
  53. tradeListObject.signMode = std::stoi(valueTradeListtrade["SignMode"].asString());
  54. if(!valueTradeListtrade["DocId"].isNull())
  55. tradeListObject.docId = valueTradeListtrade["DocId"].asString();
  56. if(!valueTradeListtrade["PeopleId"].isNull())
  57. tradeListObject.peopleId = valueTradeListtrade["PeopleId"].asString();
  58. tradeList_.push_back(tradeListObject);
  59. }
  60. if(!value["CurrentPage"].isNull())
  61. currentPage_ = std::stoi(value["CurrentPage"].asString());
  62. if(!value["ShowSize"].isNull())
  63. showSize_ = std::stoi(value["ShowSize"].asString());
  64. if(!value["TotalCount"].isNull())
  65. totalCount_ = std::stoi(value["TotalCount"].asString());
  66. }
  67. int DescribeSignatureTradeListResult::getTotalCount()const
  68. {
  69. return totalCount_;
  70. }
  71. int DescribeSignatureTradeListResult::getCurrentPage()const
  72. {
  73. return currentPage_;
  74. }
  75. int DescribeSignatureTradeListResult::getShowSize()const
  76. {
  77. return showSize_;
  78. }
  79. std::vector<DescribeSignatureTradeListResult::Trade> DescribeSignatureTradeListResult::getTradeList()const
  80. {
  81. return tradeList_;
  82. }