GetSetResult.cc 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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/imm/model/GetSetResult.h>
  17. #include <json/json.h>
  18. using namespace AlibabaCloud::Imm;
  19. using namespace AlibabaCloud::Imm::Model;
  20. GetSetResult::GetSetResult() :
  21. ServiceResult()
  22. {}
  23. GetSetResult::GetSetResult(const std::string &payload) :
  24. ServiceResult()
  25. {
  26. parse(payload);
  27. }
  28. GetSetResult::~GetSetResult()
  29. {}
  30. void GetSetResult::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. if(!value["ModifyTime"].isNull())
  37. modifyTime_ = value["ModifyTime"].asString();
  38. if(!value["VideoCount"].isNull())
  39. videoCount_ = std::stoi(value["VideoCount"].asString());
  40. if(!value["ImageCount"].isNull())
  41. imageCount_ = std::stoi(value["ImageCount"].asString());
  42. if(!value["CreateTime"].isNull())
  43. createTime_ = value["CreateTime"].asString();
  44. if(!value["SetName"].isNull())
  45. setName_ = value["SetName"].asString();
  46. if(!value["SetId"].isNull())
  47. setId_ = value["SetId"].asString();
  48. if(!value["VideoLength"].isNull())
  49. videoLength_ = std::stoi(value["VideoLength"].asString());
  50. if(!value["FaceCount"].isNull())
  51. faceCount_ = std::stoi(value["FaceCount"].asString());
  52. }
  53. std::string GetSetResult::getModifyTime()const
  54. {
  55. return modifyTime_;
  56. }
  57. int GetSetResult::getVideoCount()const
  58. {
  59. return videoCount_;
  60. }
  61. int GetSetResult::getImageCount()const
  62. {
  63. return imageCount_;
  64. }
  65. std::string GetSetResult::getCreateTime()const
  66. {
  67. return createTime_;
  68. }
  69. std::string GetSetResult::getSetName()const
  70. {
  71. return setName_;
  72. }
  73. std::string GetSetResult::getSetId()const
  74. {
  75. return setId_;
  76. }
  77. int GetSetResult::getVideoLength()const
  78. {
  79. return videoLength_;
  80. }
  81. int GetSetResult::getFaceCount()const
  82. {
  83. return faceCount_;
  84. }