DescribePersonMachineListResult.cc 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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/afs/model/DescribePersonMachineListResult.h>
  17. #include <json/json.h>
  18. using namespace AlibabaCloud::Afs;
  19. using namespace AlibabaCloud::Afs::Model;
  20. DescribePersonMachineListResult::DescribePersonMachineListResult() :
  21. ServiceResult()
  22. {}
  23. DescribePersonMachineListResult::DescribePersonMachineListResult(const std::string &payload) :
  24. ServiceResult()
  25. {
  26. parse(payload);
  27. }
  28. DescribePersonMachineListResult::~DescribePersonMachineListResult()
  29. {}
  30. void DescribePersonMachineListResult::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 allPersonMachineRes = value["PersonMachineRes"];
  37. for (auto value : allPersonMachineRes)
  38. {
  39. PersonMachineRes personMachineResObject;
  40. if(!value["HasConfiguration"].isNull())
  41. personMachineResObject.hasConfiguration = value["HasConfiguration"].asString();
  42. auto allPersonMachines = value["PersonMachines"]["PersonMachine"];
  43. for (auto value : allPersonMachines)
  44. {
  45. PersonMachineRes::PersonMachine personMachineObject;
  46. if(!value["ConfigurationName"].isNull())
  47. personMachineObject.configurationName = value["ConfigurationName"].asString();
  48. if(!value["Appkey"].isNull())
  49. personMachineObject.appkey = value["Appkey"].asString();
  50. if(!value["ConfigurationMethod"].isNull())
  51. personMachineObject.configurationMethod = value["ConfigurationMethod"].asString();
  52. if(!value["ApplyType"].isNull())
  53. personMachineObject.applyType = value["ApplyType"].asString();
  54. if(!value["Scene"].isNull())
  55. personMachineObject.scene = value["Scene"].asString();
  56. if(!value["LastUpdate"].isNull())
  57. personMachineObject.lastUpdate = value["LastUpdate"].asString();
  58. personMachineResObject.personMachines.push_back(personMachineObject);
  59. }
  60. personMachineRes_.push_back(personMachineResObject);
  61. }
  62. if(!value["BizCode"].isNull())
  63. bizCode_ = value["BizCode"].asString();
  64. }
  65. std::vector<DescribePersonMachineListResult::PersonMachineRes> DescribePersonMachineListResult::getPersonMachineRes()const
  66. {
  67. return personMachineRes_;
  68. }
  69. std::string DescribePersonMachineListResult::getBizCode()const
  70. {
  71. return bizCode_;
  72. }