QueryMeetingInfoResult.cc 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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/aliyuncvc/model/QueryMeetingInfoResult.h>
  17. #include <json/json.h>
  18. using namespace AlibabaCloud::Aliyuncvc;
  19. using namespace AlibabaCloud::Aliyuncvc::Model;
  20. QueryMeetingInfoResult::QueryMeetingInfoResult() :
  21. ServiceResult()
  22. {}
  23. QueryMeetingInfoResult::QueryMeetingInfoResult(const std::string &payload) :
  24. ServiceResult()
  25. {
  26. parse(payload);
  27. }
  28. QueryMeetingInfoResult::~QueryMeetingInfoResult()
  29. {}
  30. void QueryMeetingInfoResult::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 meetingInfoNode = value["MeetingInfo"];
  37. if(!meetingInfoNode["MeetingName"].isNull())
  38. meetingInfo_.meetingName = meetingInfoNode["MeetingName"].asString();
  39. if(!meetingInfoNode["ValidDate"].isNull())
  40. meetingInfo_.validDate = std::stol(meetingInfoNode["ValidDate"].asString());
  41. if(!meetingInfoNode["MeetingCode"].isNull())
  42. meetingInfo_.meetingCode = meetingInfoNode["MeetingCode"].asString();
  43. if(!meetingInfoNode["CreateDate"].isNull())
  44. meetingInfo_.createDate = std::stol(meetingInfoNode["CreateDate"].asString());
  45. if(!meetingInfoNode["UserId"].isNull())
  46. meetingInfo_.userId = meetingInfoNode["UserId"].asString();
  47. if(!meetingInfoNode["MeetingUUID"].isNull())
  48. meetingInfo_.meetingUUID = meetingInfoNode["MeetingUUID"].asString();
  49. auto allMemberListNode = meetingInfoNode["MemberList"]["MemberListItem"];
  50. for (auto meetingInfoNodeMemberListMemberListItem : allMemberListNode)
  51. {
  52. MeetingInfo::MemberListItem memberListItemObject;
  53. if(!meetingInfoNodeMemberListMemberListItem["UserAvatarUrl"].isNull())
  54. memberListItemObject.userAvatarUrl = meetingInfoNodeMemberListMemberListItem["UserAvatarUrl"].asString();
  55. if(!meetingInfoNodeMemberListMemberListItem["MemberUUID"].isNull())
  56. memberListItemObject.memberUUID = meetingInfoNodeMemberListMemberListItem["MemberUUID"].asString();
  57. if(!meetingInfoNodeMemberListMemberListItem["UserName"].isNull())
  58. memberListItemObject.userName = meetingInfoNodeMemberListMemberListItem["UserName"].asString();
  59. if(!meetingInfoNodeMemberListMemberListItem["UserId"].isNull())
  60. memberListItemObject.userId = meetingInfoNodeMemberListMemberListItem["UserId"].asString();
  61. if(!meetingInfoNodeMemberListMemberListItem["Status"].isNull())
  62. memberListItemObject.status = meetingInfoNodeMemberListMemberListItem["Status"].asString();
  63. meetingInfo_.memberList.push_back(memberListItemObject);
  64. }
  65. if(!value["ErrorCode"].isNull())
  66. errorCode_ = std::stoi(value["ErrorCode"].asString());
  67. if(!value["Message"].isNull())
  68. message_ = value["Message"].asString();
  69. if(!value["Success"].isNull())
  70. success_ = value["Success"].asString() == "true";
  71. }
  72. QueryMeetingInfoResult::MeetingInfo QueryMeetingInfoResult::getMeetingInfo()const
  73. {
  74. return meetingInfo_;
  75. }
  76. std::string QueryMeetingInfoResult::getMessage()const
  77. {
  78. return message_;
  79. }
  80. int QueryMeetingInfoResult::getErrorCode()const
  81. {
  82. return errorCode_;
  83. }
  84. bool QueryMeetingInfoResult::getSuccess()const
  85. {
  86. return success_;
  87. }