GetDevopsProjectTaskInfoResult.cc 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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/GetDevopsProjectTaskInfoResult.h>
  17. #include <json/json.h>
  18. using namespace AlibabaCloud::Devops_rdc;
  19. using namespace AlibabaCloud::Devops_rdc::Model;
  20. GetDevopsProjectTaskInfoResult::GetDevopsProjectTaskInfoResult() :
  21. ServiceResult()
  22. {}
  23. GetDevopsProjectTaskInfoResult::GetDevopsProjectTaskInfoResult(const std::string &payload) :
  24. ServiceResult()
  25. {
  26. parse(payload);
  27. }
  28. GetDevopsProjectTaskInfoResult::~GetDevopsProjectTaskInfoResult()
  29. {}
  30. void GetDevopsProjectTaskInfoResult::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["TasklistId"].isNull())
  38. object_.tasklistId = objectNode["TasklistId"].asString();
  39. if(!objectNode["TaskflowstatusId"].isNull())
  40. object_.taskflowstatusId = objectNode["TaskflowstatusId"].asString();
  41. if(!objectNode["TaskType"].isNull())
  42. object_.taskType = objectNode["TaskType"].asString();
  43. if(!objectNode["IsDeleted"].isNull())
  44. object_.isDeleted = objectNode["IsDeleted"].asString() == "true";
  45. if(!objectNode["CreatorId"].isNull())
  46. object_.creatorId = objectNode["CreatorId"].asString();
  47. if(!objectNode["IsTopInProject"].isNull())
  48. object_.isTopInProject = objectNode["IsTopInProject"].asString() == "true";
  49. if(!objectNode["ExecutorId"].isNull())
  50. object_.executorId = objectNode["ExecutorId"].asString();
  51. if(!objectNode["StoryPoint"].isNull())
  52. object_.storyPoint = objectNode["StoryPoint"].asString();
  53. if(!objectNode["Created"].isNull())
  54. object_.created = objectNode["Created"].asString();
  55. if(!objectNode["OrganizationId"].isNull())
  56. object_.organizationId = objectNode["OrganizationId"].asString();
  57. if(!objectNode["IsDone"].isNull())
  58. object_.isDone = objectNode["IsDone"].asString() == "true";
  59. if(!objectNode["Id"].isNull())
  60. object_.id = objectNode["Id"].asString();
  61. if(!objectNode["Updated"].isNull())
  62. object_.updated = objectNode["Updated"].asString();
  63. if(!objectNode["SprintId"].isNull())
  64. object_.sprintId = objectNode["SprintId"].asString();
  65. if(!objectNode["ProjectId"].isNull())
  66. object_.projectId = objectNode["ProjectId"].asString();
  67. if(!objectNode["Content"].isNull())
  68. object_.content = objectNode["Content"].asString();
  69. if(!objectNode["Note"].isNull())
  70. object_.note = objectNode["Note"].asString();
  71. if(!objectNode["DueDate"].isNull())
  72. object_.dueDate = objectNode["DueDate"].asString();
  73. if(!objectNode["StartDate"].isNull())
  74. object_.startDate = objectNode["StartDate"].asString();
  75. if(!objectNode["Visible"].isNull())
  76. object_.visible = objectNode["Visible"].asString();
  77. if(!objectNode["Priority"].isNull())
  78. object_.priority = objectNode["Priority"].asString();
  79. auto allInvolveMembers = objectNode["InvolveMembers"]["InvolveMember"];
  80. for (auto value : allInvolveMembers)
  81. object_.involveMembers.push_back(value.asString());
  82. if(!value["Successful"].isNull())
  83. successful_ = value["Successful"].asString() == "true";
  84. if(!value["ErrorCode"].isNull())
  85. errorCode_ = value["ErrorCode"].asString();
  86. if(!value["ErrorMsg"].isNull())
  87. errorMsg_ = value["ErrorMsg"].asString();
  88. }
  89. std::string GetDevopsProjectTaskInfoResult::getErrorMsg()const
  90. {
  91. return errorMsg_;
  92. }
  93. GetDevopsProjectTaskInfoResult::Object GetDevopsProjectTaskInfoResult::getObject()const
  94. {
  95. return object_;
  96. }
  97. std::string GetDevopsProjectTaskInfoResult::getErrorCode()const
  98. {
  99. return errorCode_;
  100. }
  101. bool GetDevopsProjectTaskInfoResult::getSuccessful()const
  102. {
  103. return successful_;
  104. }