GetDevopsProjectInfoResult.cc 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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/devops-rdc/model/GetDevopsProjectInfoResult.h>
  17. #include <json/json.h>
  18. using namespace AlibabaCloud::Devops_rdc;
  19. using namespace AlibabaCloud::Devops_rdc::Model;
  20. GetDevopsProjectInfoResult::GetDevopsProjectInfoResult() :
  21. ServiceResult()
  22. {}
  23. GetDevopsProjectInfoResult::GetDevopsProjectInfoResult(const std::string &payload) :
  24. ServiceResult()
  25. {
  26. parse(payload);
  27. }
  28. GetDevopsProjectInfoResult::~GetDevopsProjectInfoResult()
  29. {}
  30. void GetDevopsProjectInfoResult::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 objectNode = value["Object"];
  37. if(!objectNode["SortMethod"].isNull())
  38. object_.sortMethod = objectNode["SortMethod"].asString();
  39. if(!objectNode["UniqueIdPrefix"].isNull())
  40. object_.uniqueIdPrefix = objectNode["UniqueIdPrefix"].asString();
  41. if(!objectNode["NormalType"].isNull())
  42. object_.normalType = objectNode["NormalType"].asString();
  43. if(!objectNode["ModifierId"].isNull())
  44. object_.modifierId = objectNode["ModifierId"].asString();
  45. if(!objectNode["SourceType"].isNull())
  46. object_.sourceType = objectNode["SourceType"].asString();
  47. if(!objectNode["IsTemplate"].isNull())
  48. object_.isTemplate = objectNode["IsTemplate"].asString() == "true";
  49. if(!objectNode["Description"].isNull())
  50. object_.description = objectNode["Description"].asString();
  51. if(!objectNode["DefaultRoleId"].isNull())
  52. object_.defaultRoleId = objectNode["DefaultRoleId"].asString();
  53. if(!objectNode["RootCollectionId"].isNull())
  54. object_.rootCollectionId = objectNode["RootCollectionId"].asString();
  55. if(!objectNode["IsDeleted"].isNull())
  56. object_.isDeleted = objectNode["IsDeleted"].asString() == "true";
  57. if(!objectNode["Updated"].isNull())
  58. object_.updated = objectNode["Updated"].asString();
  59. if(!objectNode["Name"].isNull())
  60. object_.name = objectNode["Name"].asString();
  61. if(!objectNode["IsArchived"].isNull())
  62. object_.isArchived = objectNode["IsArchived"].asString() == "true";
  63. if(!objectNode["EndDate"].isNull())
  64. object_.endDate = objectNode["EndDate"].asString();
  65. if(!objectNode["Logo"].isNull())
  66. object_.logo = objectNode["Logo"].asString();
  67. if(!objectNode["StartDate"].isNull())
  68. object_.startDate = objectNode["StartDate"].asString();
  69. if(!objectNode["Pinyin"].isNull())
  70. object_.pinyin = objectNode["Pinyin"].asString();
  71. if(!objectNode["CreatorId"].isNull())
  72. object_.creatorId = objectNode["CreatorId"].asString();
  73. if(!objectNode["SourceId"].isNull())
  74. object_.sourceId = objectNode["SourceId"].asString();
  75. if(!objectNode["DefaultCollectionId"].isNull())
  76. object_.defaultCollectionId = objectNode["DefaultCollectionId"].asString();
  77. if(!objectNode["IsSuspended"].isNull())
  78. object_.isSuspended = objectNode["IsSuspended"].asString() == "true";
  79. if(!objectNode["OrganizationId"].isNull())
  80. object_.organizationId = objectNode["OrganizationId"].asString();
  81. if(!objectNode["Visibility"].isNull())
  82. object_.visibility = objectNode["Visibility"].asString();
  83. if(!objectNode["Py"].isNull())
  84. object_.py = objectNode["Py"].asString();
  85. if(!objectNode["Category"].isNull())
  86. object_.category = objectNode["Category"].asString();
  87. if(!objectNode["NextTaskUniqueId"].isNull())
  88. object_.nextTaskUniqueId = std::stoi(objectNode["NextTaskUniqueId"].asString());
  89. if(!objectNode["Customfields"].isNull())
  90. object_.customfields = objectNode["Customfields"].asString();
  91. if(!objectNode["Created"].isNull())
  92. object_.created = objectNode["Created"].asString();
  93. if(!objectNode["Id"].isNull())
  94. object_.id = objectNode["Id"].asString();
  95. if(!value["ErrorMsg"].isNull())
  96. errorMsg_ = value["ErrorMsg"].asString();
  97. if(!value["Successful"].isNull())
  98. successful_ = value["Successful"].asString() == "true";
  99. if(!value["ErrorCode"].isNull())
  100. errorCode_ = value["ErrorCode"].asString();
  101. }
  102. std::string GetDevopsProjectInfoResult::getErrorMsg()const
  103. {
  104. return errorMsg_;
  105. }
  106. GetDevopsProjectInfoResult::Object GetDevopsProjectInfoResult::getObject()const
  107. {
  108. return object_;
  109. }
  110. std::string GetDevopsProjectInfoResult::getErrorCode()const
  111. {
  112. return errorCode_;
  113. }
  114. bool GetDevopsProjectInfoResult::getSuccessful()const
  115. {
  116. return successful_;
  117. }