CreateLiveStreamRecordIndexFilesResult.cc 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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/CreateLiveStreamRecordIndexFilesResult.h>
  17. #include <json/json.h>
  18. using namespace AlibabaCloud::Live;
  19. using namespace AlibabaCloud::Live::Model;
  20. CreateLiveStreamRecordIndexFilesResult::CreateLiveStreamRecordIndexFilesResult() :
  21. ServiceResult()
  22. {}
  23. CreateLiveStreamRecordIndexFilesResult::CreateLiveStreamRecordIndexFilesResult(const std::string &payload) :
  24. ServiceResult()
  25. {
  26. parse(payload);
  27. }
  28. CreateLiveStreamRecordIndexFilesResult::~CreateLiveStreamRecordIndexFilesResult()
  29. {}
  30. void CreateLiveStreamRecordIndexFilesResult::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 recordInfoNode = value["RecordInfo"];
  37. if(!recordInfoNode["RecordId"].isNull())
  38. recordInfo_.recordId = recordInfoNode["RecordId"].asString();
  39. if(!recordInfoNode["RecordUrl"].isNull())
  40. recordInfo_.recordUrl = recordInfoNode["RecordUrl"].asString();
  41. if(!recordInfoNode["DomainName"].isNull())
  42. recordInfo_.domainName = recordInfoNode["DomainName"].asString();
  43. if(!recordInfoNode["AppName"].isNull())
  44. recordInfo_.appName = recordInfoNode["AppName"].asString();
  45. if(!recordInfoNode["StreamName"].isNull())
  46. recordInfo_.streamName = recordInfoNode["StreamName"].asString();
  47. if(!recordInfoNode["OssBucket"].isNull())
  48. recordInfo_.ossBucket = recordInfoNode["OssBucket"].asString();
  49. if(!recordInfoNode["OssEndpoint"].isNull())
  50. recordInfo_.ossEndpoint = recordInfoNode["OssEndpoint"].asString();
  51. if(!recordInfoNode["OssObject"].isNull())
  52. recordInfo_.ossObject = recordInfoNode["OssObject"].asString();
  53. if(!recordInfoNode["StartTime"].isNull())
  54. recordInfo_.startTime = recordInfoNode["StartTime"].asString();
  55. if(!recordInfoNode["EndTime"].isNull())
  56. recordInfo_.endTime = recordInfoNode["EndTime"].asString();
  57. if(!recordInfoNode["Duration"].isNull())
  58. recordInfo_.duration = std::stof(recordInfoNode["Duration"].asString());
  59. if(!recordInfoNode["Height"].isNull())
  60. recordInfo_.height = std::stoi(recordInfoNode["Height"].asString());
  61. if(!recordInfoNode["Width"].isNull())
  62. recordInfo_.width = std::stoi(recordInfoNode["Width"].asString());
  63. if(!recordInfoNode["CreateTime"].isNull())
  64. recordInfo_.createTime = recordInfoNode["CreateTime"].asString();
  65. }
  66. CreateLiveStreamRecordIndexFilesResult::RecordInfo CreateLiveStreamRecordIndexFilesResult::getRecordInfo()const
  67. {
  68. return recordInfo_;
  69. }