DescribeLiveMessageGroupResult.cc 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  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/live/model/DescribeLiveMessageGroupResult.h>
  17. #include <json/json.h>
  18. using namespace AlibabaCloud::Live;
  19. using namespace AlibabaCloud::Live::Model;
  20. DescribeLiveMessageGroupResult::DescribeLiveMessageGroupResult() :
  21. ServiceResult()
  22. {}
  23. DescribeLiveMessageGroupResult::DescribeLiveMessageGroupResult(const std::string &payload) :
  24. ServiceResult()
  25. {
  26. parse(payload);
  27. }
  28. DescribeLiveMessageGroupResult::~DescribeLiveMessageGroupResult()
  29. {}
  30. void DescribeLiveMessageGroupResult::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 allAdminList = value["AdminList"]["Admins"];
  37. for (const auto &item : allAdminList)
  38. adminList_.push_back(item.asString());
  39. if(!value["GroupId"].isNull())
  40. groupId_ = value["GroupId"].asString();
  41. if(!value["CreatorId"].isNull())
  42. creatorId_ = value["CreatorId"].asString();
  43. if(!value["Createtime"].isNull())
  44. createtime_ = std::stol(value["Createtime"].asString());
  45. if(!value["GroupName"].isNull())
  46. groupName_ = value["GroupName"].asString();
  47. if(!value["GroupInfo"].isNull())
  48. groupInfo_ = value["GroupInfo"].asString();
  49. if(!value["Delete"].isNull())
  50. _delete_ = value["Delete"].asString() == "true";
  51. if(!value["TotalTimes"].isNull())
  52. totalTimes_ = std::stol(value["TotalTimes"].asString());
  53. if(!value["OnlineUserCounts"].isNull())
  54. onlineUserCounts_ = std::stol(value["OnlineUserCounts"].asString());
  55. if(!value["MsgAmount"].isNull())
  56. msgAmount_ = value["MsgAmount"].asString();
  57. if(!value["Deletatime"].isNull())
  58. deletatime_ = std::stol(value["Deletatime"].asString());
  59. if(!value["Deletor"].isNull())
  60. deletor_ = value["Deletor"].asString();
  61. if(!value["SuperLargeGroup"].isNull())
  62. superLargeGroup_ = value["SuperLargeGroup"].asString() == "true";
  63. }
  64. std::string DescribeLiveMessageGroupResult::getGroupName()const
  65. {
  66. return groupName_;
  67. }
  68. long DescribeLiveMessageGroupResult::getDeletatime()const
  69. {
  70. return deletatime_;
  71. }
  72. bool DescribeLiveMessageGroupResult::getSuperLargeGroup()const
  73. {
  74. return superLargeGroup_;
  75. }
  76. long DescribeLiveMessageGroupResult::getTotalTimes()const
  77. {
  78. return totalTimes_;
  79. }
  80. std::string DescribeLiveMessageGroupResult::getMsgAmount()const
  81. {
  82. return msgAmount_;
  83. }
  84. std::string DescribeLiveMessageGroupResult::getGroupInfo()const
  85. {
  86. return groupInfo_;
  87. }
  88. std::string DescribeLiveMessageGroupResult::getCreatorId()const
  89. {
  90. return creatorId_;
  91. }
  92. long DescribeLiveMessageGroupResult::getOnlineUserCounts()const
  93. {
  94. return onlineUserCounts_;
  95. }
  96. std::string DescribeLiveMessageGroupResult::getGroupId()const
  97. {
  98. return groupId_;
  99. }
  100. std::vector<std::string> DescribeLiveMessageGroupResult::getAdminList()const
  101. {
  102. return adminList_;
  103. }
  104. bool DescribeLiveMessageGroupResult::get_Delete()const
  105. {
  106. return _delete_;
  107. }
  108. long DescribeLiveMessageGroupResult::getCreatetime()const
  109. {
  110. return createtime_;
  111. }
  112. std::string DescribeLiveMessageGroupResult::getDeletor()const
  113. {
  114. return deletor_;
  115. }