BatchCreateSandBoxWhileListResult.cc 2.9 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/voicenavigator/model/BatchCreateSandBoxWhileListResult.h>
  17. #include <json/json.h>
  18. using namespace AlibabaCloud::VoiceNavigator;
  19. using namespace AlibabaCloud::VoiceNavigator::Model;
  20. BatchCreateSandBoxWhileListResult::BatchCreateSandBoxWhileListResult() :
  21. ServiceResult()
  22. {}
  23. BatchCreateSandBoxWhileListResult::BatchCreateSandBoxWhileListResult(const std::string &payload) :
  24. ServiceResult()
  25. {
  26. parse(payload);
  27. }
  28. BatchCreateSandBoxWhileListResult::~BatchCreateSandBoxWhileListResult()
  29. {}
  30. void BatchCreateSandBoxWhileListResult::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 allWhiteListNode = value["WhiteList"]["WhiteListItem"];
  37. for (auto valueWhiteListWhiteListItem : allWhiteListNode)
  38. {
  39. WhiteListItem whiteListObject;
  40. if(!valueWhiteListWhiteListItem["Uuid"].isNull())
  41. whiteListObject.uuid = valueWhiteListWhiteListItem["Uuid"].asString();
  42. if(!valueWhiteListWhiteListItem["PhoneNumber"].isNull())
  43. whiteListObject.phoneNumber = valueWhiteListWhiteListItem["PhoneNumber"].asString();
  44. if(!valueWhiteListWhiteListItem["Description"].isNull())
  45. whiteListObject.description = valueWhiteListWhiteListItem["Description"].asString();
  46. if(!valueWhiteListWhiteListItem["IsEnable"].isNull())
  47. whiteListObject.isEnable = std::stoi(valueWhiteListWhiteListItem["IsEnable"].asString());
  48. if(!valueWhiteListWhiteListItem["GmtCreate"].isNull())
  49. whiteListObject.gmtCreate = std::stol(valueWhiteListWhiteListItem["GmtCreate"].asString());
  50. if(!valueWhiteListWhiteListItem["InstanceId"].isNull())
  51. whiteListObject.instanceId = valueWhiteListWhiteListItem["InstanceId"].asString();
  52. if(!valueWhiteListWhiteListItem["GmtModified"].isNull())
  53. whiteListObject.gmtModified = std::stol(valueWhiteListWhiteListItem["GmtModified"].asString());
  54. if(!valueWhiteListWhiteListItem["Name"].isNull())
  55. whiteListObject.name = valueWhiteListWhiteListItem["Name"].asString();
  56. whiteList_.push_back(whiteListObject);
  57. }
  58. if(!value["Repeat"].isNull())
  59. repeat_ = value["Repeat"].asString() == "true";
  60. }
  61. std::vector<BatchCreateSandBoxWhileListResult::WhiteListItem> BatchCreateSandBoxWhileListResult::getWhiteList()const
  62. {
  63. return whiteList_;
  64. }
  65. bool BatchCreateSandBoxWhileListResult::getRepeat()const
  66. {
  67. return repeat_;
  68. }