CreateDevopsProjectTaskResult.cc 4.3 KB

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