-
Notifications
You must be signed in to change notification settings - Fork 76
/
Copy pathCreateProjectResult.cc
110 lines (97 loc) · 3.61 KB
/
CreateProjectResult.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <alibabacloud/devops/model/CreateProjectResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Devops;
using namespace AlibabaCloud::Devops::Model;
CreateProjectResult::CreateProjectResult() :
ServiceResult()
{}
CreateProjectResult::CreateProjectResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
CreateProjectResult::~CreateProjectResult()
{}
void CreateProjectResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto projectNode = value["project"];
if(!projectNode["categoryIdentifier"].isNull())
project_.categoryIdentifier = projectNode["categoryIdentifier"].asString();
if(!projectNode["creator"].isNull())
project_.creator = projectNode["creator"].asString();
if(!projectNode["customCode"].isNull())
project_.customCode = projectNode["customCode"].asString();
if(!projectNode["description"].isNull())
project_.description = projectNode["description"].asString();
if(!projectNode["gmtCreate"].isNull())
project_.gmtCreate = std::stol(projectNode["gmtCreate"].asString());
if(!projectNode["gmtModified"].isNull())
project_.gmtModified = std::stol(projectNode["gmtModified"].asString());
if(!projectNode["icon"].isNull())
project_.icon = projectNode["icon"].asString();
if(!projectNode["identifier"].isNull())
project_.identifier = projectNode["identifier"].asString();
if(!projectNode["logicalStatus"].isNull())
project_.logicalStatus = projectNode["logicalStatus"].asString();
if(!projectNode["modifier"].isNull())
project_.modifier = projectNode["modifier"].asString();
if(!projectNode["name"].isNull())
project_.name = projectNode["name"].asString();
if(!projectNode["organizationIdentifier"].isNull())
project_.organizationIdentifier = projectNode["organizationIdentifier"].asString();
if(!projectNode["scope"].isNull())
project_.scope = projectNode["scope"].asString();
if(!projectNode["statusIdentifier"].isNull())
project_.statusIdentifier = projectNode["statusIdentifier"].asString();
if(!projectNode["statusStageIdentifier"].isNull())
project_.statusStageIdentifier = projectNode["statusStageIdentifier"].asString();
if(!projectNode["typeIdentifier"].isNull())
project_.typeIdentifier = projectNode["typeIdentifier"].asString();
if(!value["requestId"].isNull())
requestId_ = value["requestId"].asString();
if(!value["errorMsg"].isNull())
errorMsg_ = value["errorMsg"].asString();
if(!value["errorCode"].isNull())
errorCode_ = value["errorCode"].asString();
if(!value["success"].isNull())
success_ = value["success"].asString() == "true";
}
CreateProjectResult::Project CreateProjectResult::getProject()const
{
return project_;
}
std::string CreateProjectResult::getRequestId()const
{
return requestId_;
}
std::string CreateProjectResult::getErrorMsg()const
{
return errorMsg_;
}
std::string CreateProjectResult::getErrorCode()const
{
return errorCode_;
}
bool CreateProjectResult::getSuccess()const
{
return success_;
}