DescribeLiveRecordConfigResult.cc 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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/DescribeLiveRecordConfigResult.h>
  17. #include <json/json.h>
  18. using namespace AlibabaCloud::Live;
  19. using namespace AlibabaCloud::Live::Model;
  20. DescribeLiveRecordConfigResult::DescribeLiveRecordConfigResult() :
  21. ServiceResult()
  22. {}
  23. DescribeLiveRecordConfigResult::DescribeLiveRecordConfigResult(const std::string &payload) :
  24. ServiceResult()
  25. {
  26. parse(payload);
  27. }
  28. DescribeLiveRecordConfigResult::~DescribeLiveRecordConfigResult()
  29. {}
  30. void DescribeLiveRecordConfigResult::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 allLiveAppRecordList = value["LiveAppRecordList"]["LiveAppRecord"];
  37. for (auto value : allLiveAppRecordList)
  38. {
  39. LiveAppRecord liveAppRecordListObject;
  40. if(!value["DomainName"].isNull())
  41. liveAppRecordListObject.domainName = value["DomainName"].asString();
  42. if(!value["AppName"].isNull())
  43. liveAppRecordListObject.appName = value["AppName"].asString();
  44. if(!value["StreamName"].isNull())
  45. liveAppRecordListObject.streamName = value["StreamName"].asString();
  46. if(!value["OssEndpoint"].isNull())
  47. liveAppRecordListObject.ossEndpoint = value["OssEndpoint"].asString();
  48. if(!value["OssBucket"].isNull())
  49. liveAppRecordListObject.ossBucket = value["OssBucket"].asString();
  50. if(!value["CreateTime"].isNull())
  51. liveAppRecordListObject.createTime = value["CreateTime"].asString();
  52. if(!value["StartTime"].isNull())
  53. liveAppRecordListObject.startTime = value["StartTime"].asString();
  54. if(!value["EndTime"].isNull())
  55. liveAppRecordListObject.endTime = value["EndTime"].asString();
  56. if(!value["OnDemond"].isNull())
  57. liveAppRecordListObject.onDemond = std::stoi(value["OnDemond"].asString());
  58. auto allRecordFormatList = value["RecordFormatList"]["RecordFormat"];
  59. for (auto value : allRecordFormatList)
  60. {
  61. LiveAppRecord::RecordFormat recordFormatListObject;
  62. if(!value["Format"].isNull())
  63. recordFormatListObject.format = value["Format"].asString();
  64. if(!value["OssObjectPrefix"].isNull())
  65. recordFormatListObject.ossObjectPrefix = value["OssObjectPrefix"].asString();
  66. if(!value["SliceOssObjectPrefix"].isNull())
  67. recordFormatListObject.sliceOssObjectPrefix = value["SliceOssObjectPrefix"].asString();
  68. if(!value["CycleDuration"].isNull())
  69. recordFormatListObject.cycleDuration = std::stoi(value["CycleDuration"].asString());
  70. liveAppRecordListObject.recordFormatList.push_back(recordFormatListObject);
  71. }
  72. liveAppRecordList_.push_back(liveAppRecordListObject);
  73. }
  74. if(!value["PageNum"].isNull())
  75. pageNum_ = std::stoi(value["PageNum"].asString());
  76. if(!value["PageSize"].isNull())
  77. pageSize_ = std::stoi(value["PageSize"].asString());
  78. if(!value["Order"].isNull())
  79. order_ = value["Order"].asString();
  80. if(!value["TotalNum"].isNull())
  81. totalNum_ = std::stoi(value["TotalNum"].asString());
  82. if(!value["TotalPage"].isNull())
  83. totalPage_ = std::stoi(value["TotalPage"].asString());
  84. }
  85. std::string DescribeLiveRecordConfigResult::getOrder()const
  86. {
  87. return order_;
  88. }
  89. int DescribeLiveRecordConfigResult::getTotalNum()const
  90. {
  91. return totalNum_;
  92. }
  93. int DescribeLiveRecordConfigResult::getPageNum()const
  94. {
  95. return pageNum_;
  96. }
  97. int DescribeLiveRecordConfigResult::getPageSize()const
  98. {
  99. return pageSize_;
  100. }
  101. int DescribeLiveRecordConfigResult::getTotalPage()const
  102. {
  103. return totalPage_;
  104. }
  105. std::vector<DescribeLiveRecordConfigResult::LiveAppRecord> DescribeLiveRecordConfigResult::getLiveAppRecordList()const
  106. {
  107. return liveAppRecordList_;
  108. }