DescribeRTSNativeSDKPlayTimeResult.cc 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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/DescribeRTSNativeSDKPlayTimeResult.h>
  17. #include <json/json.h>
  18. using namespace AlibabaCloud::Live;
  19. using namespace AlibabaCloud::Live::Model;
  20. DescribeRTSNativeSDKPlayTimeResult::DescribeRTSNativeSDKPlayTimeResult() :
  21. ServiceResult()
  22. {}
  23. DescribeRTSNativeSDKPlayTimeResult::DescribeRTSNativeSDKPlayTimeResult(const std::string &payload) :
  24. ServiceResult()
  25. {
  26. parse(payload);
  27. }
  28. DescribeRTSNativeSDKPlayTimeResult::~DescribeRTSNativeSDKPlayTimeResult()
  29. {}
  30. void DescribeRTSNativeSDKPlayTimeResult::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 allPlayTimeDataNode = value["PlayTimeData"]["Data"];
  37. for (auto valuePlayTimeDataData : allPlayTimeDataNode)
  38. {
  39. Data playTimeDataObject;
  40. if(!valuePlayTimeDataData["PlayTime"].isNull())
  41. playTimeDataObject.playTime = valuePlayTimeDataData["PlayTime"].asString();
  42. if(!valuePlayTimeDataData["StallTime"].isNull())
  43. playTimeDataObject.stallTime = valuePlayTimeDataData["StallTime"].asString();
  44. if(!valuePlayTimeDataData["TimeStamp"].isNull())
  45. playTimeDataObject.timeStamp = valuePlayTimeDataData["TimeStamp"].asString();
  46. playTimeData_.push_back(playTimeDataObject);
  47. }
  48. if(!value["DataInterval"].isNull())
  49. dataInterval_ = value["DataInterval"].asString();
  50. if(!value["EndTime"].isNull())
  51. endTime_ = value["EndTime"].asString();
  52. if(!value["StartTime"].isNull())
  53. startTime_ = value["StartTime"].asString();
  54. }
  55. std::string DescribeRTSNativeSDKPlayTimeResult::getEndTime()const
  56. {
  57. return endTime_;
  58. }
  59. std::vector<DescribeRTSNativeSDKPlayTimeResult::Data> DescribeRTSNativeSDKPlayTimeResult::getPlayTimeData()const
  60. {
  61. return playTimeData_;
  62. }
  63. std::string DescribeRTSNativeSDKPlayTimeResult::getDataInterval()const
  64. {
  65. return dataInterval_;
  66. }
  67. std::string DescribeRTSNativeSDKPlayTimeResult::getStartTime()const
  68. {
  69. return startTime_;
  70. }