DescribeUserBizTypesResult.cc 3.0 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/green/model/DescribeUserBizTypesResult.h>
  17. #include <json/json.h>
  18. using namespace AlibabaCloud::Green;
  19. using namespace AlibabaCloud::Green::Model;
  20. DescribeUserBizTypesResult::DescribeUserBizTypesResult() :
  21. ServiceResult()
  22. {}
  23. DescribeUserBizTypesResult::DescribeUserBizTypesResult(const std::string &payload) :
  24. ServiceResult()
  25. {
  26. parse(payload);
  27. }
  28. DescribeUserBizTypesResult::~DescribeUserBizTypesResult()
  29. {}
  30. void DescribeUserBizTypesResult::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 allBizTypeListNode = value["BizTypeList"]["item"];
  37. for (auto valueBizTypeListitem : allBizTypeListNode)
  38. {
  39. Item bizTypeListObject;
  40. if(!valueBizTypeListitem["BizType"].isNull())
  41. bizTypeListObject.bizType = valueBizTypeListitem["BizType"].asString();
  42. if(!valueBizTypeListitem["SourceBizType"].isNull())
  43. bizTypeListObject.sourceBizType = valueBizTypeListitem["SourceBizType"].asString();
  44. if(!valueBizTypeListitem["Gray"].isNull())
  45. bizTypeListObject.gray = valueBizTypeListitem["Gray"].asString() == "true";
  46. if(!valueBizTypeListitem["Source"].isNull())
  47. bizTypeListObject.source = valueBizTypeListitem["Source"].asString();
  48. bizTypeList_.push_back(bizTypeListObject);
  49. }
  50. auto allBizTypeListImportNode = value["BizTypeListImport"]["item"];
  51. for (auto valueBizTypeListImportitem : allBizTypeListImportNode)
  52. {
  53. Item bizTypeListImportObject;
  54. if(!valueBizTypeListImportitem["BizType"].isNull())
  55. bizTypeListImportObject.bizType = valueBizTypeListImportitem["BizType"].asString();
  56. if(!valueBizTypeListImportitem["SourceBizType"].isNull())
  57. bizTypeListImportObject.sourceBizType = valueBizTypeListImportitem["SourceBizType"].asString();
  58. if(!valueBizTypeListImportitem["Gray"].isNull())
  59. bizTypeListImportObject.gray = valueBizTypeListImportitem["Gray"].asString() == "true";
  60. if(!valueBizTypeListImportitem["Source"].isNull())
  61. bizTypeListImportObject.source = valueBizTypeListImportitem["Source"].asString();
  62. bizTypeListImport_.push_back(bizTypeListImportObject);
  63. }
  64. }
  65. std::vector<DescribeUserBizTypesResult::Item> DescribeUserBizTypesResult::getBizTypeList()const
  66. {
  67. return bizTypeList_;
  68. }
  69. std::vector<DescribeUserBizTypesResult::Item> DescribeUserBizTypesResult::getBizTypeListImport()const
  70. {
  71. return bizTypeListImport_;
  72. }