Generated 2018-03-13 for retailcloud.

This commit is contained in:
sdk-team
2021-01-28 03:37:50 +00:00
parent caf80426a4
commit 38eb8f243a
27 changed files with 1570 additions and 72 deletions

View File

@@ -87,6 +87,42 @@ RetailcloudClient::AddClusterNodeOutcomeCallable RetailcloudClient::addClusterNo
return task->get_future();
}
RetailcloudClient::AllocatePodConfigOutcome RetailcloudClient::allocatePodConfig(const AllocatePodConfigRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return AllocatePodConfigOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return AllocatePodConfigOutcome(AllocatePodConfigResult(outcome.result()));
else
return AllocatePodConfigOutcome(outcome.error());
}
void RetailcloudClient::allocatePodConfigAsync(const AllocatePodConfigRequest& request, const AllocatePodConfigAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, allocatePodConfig(request), context);
};
asyncExecute(new Runnable(fn));
}
RetailcloudClient::AllocatePodConfigOutcomeCallable RetailcloudClient::allocatePodConfigCallable(const AllocatePodConfigRequest &request) const
{
auto task = std::make_shared<std::packaged_task<AllocatePodConfigOutcome()>>(
[this, request]()
{
return this->allocatePodConfig(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
RetailcloudClient::BatchAddServersOutcome RetailcloudClient::batchAddServers(const BatchAddServersRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -1203,6 +1239,42 @@ RetailcloudClient::DescribeAppResourceAllocOutcomeCallable RetailcloudClient::de
return task->get_future();
}
RetailcloudClient::DescribeClusterDetailOutcome RetailcloudClient::describeClusterDetail(const DescribeClusterDetailRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return DescribeClusterDetailOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return DescribeClusterDetailOutcome(DescribeClusterDetailResult(outcome.result()));
else
return DescribeClusterDetailOutcome(outcome.error());
}
void RetailcloudClient::describeClusterDetailAsync(const DescribeClusterDetailRequest& request, const DescribeClusterDetailAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, describeClusterDetail(request), context);
};
asyncExecute(new Runnable(fn));
}
RetailcloudClient::DescribeClusterDetailOutcomeCallable RetailcloudClient::describeClusterDetailCallable(const DescribeClusterDetailRequest &request) const
{
auto task = std::make_shared<std::packaged_task<DescribeClusterDetailOutcome()>>(
[this, request]()
{
return this->describeClusterDetail(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
RetailcloudClient::DescribeDatabasesOutcome RetailcloudClient::describeDatabases(const DescribeDatabasesRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -2643,6 +2715,78 @@ RetailcloudClient::SetDeployPauseTypeOutcomeCallable RetailcloudClient::setDeplo
return task->get_future();
}
RetailcloudClient::SubmitInfoOutcome RetailcloudClient::submitInfo(const SubmitInfoRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return SubmitInfoOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return SubmitInfoOutcome(SubmitInfoResult(outcome.result()));
else
return SubmitInfoOutcome(outcome.error());
}
void RetailcloudClient::submitInfoAsync(const SubmitInfoRequest& request, const SubmitInfoAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, submitInfo(request), context);
};
asyncExecute(new Runnable(fn));
}
RetailcloudClient::SubmitInfoOutcomeCallable RetailcloudClient::submitInfoCallable(const SubmitInfoRequest &request) const
{
auto task = std::make_shared<std::packaged_task<SubmitInfoOutcome()>>(
[this, request]()
{
return this->submitInfo(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
RetailcloudClient::SyncPodInfoOutcome RetailcloudClient::syncPodInfo(const SyncPodInfoRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return SyncPodInfoOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return SyncPodInfoOutcome(SyncPodInfoResult(outcome.result()));
else
return SyncPodInfoOutcome(outcome.error());
}
void RetailcloudClient::syncPodInfoAsync(const SyncPodInfoRequest& request, const SyncPodInfoAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, syncPodInfo(request), context);
};
asyncExecute(new Runnable(fn));
}
RetailcloudClient::SyncPodInfoOutcomeCallable RetailcloudClient::syncPodInfoCallable(const SyncPodInfoRequest &request) const
{
auto task = std::make_shared<std::packaged_task<SyncPodInfoOutcome()>>(
[this, request]()
{
return this->syncPodInfo(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
RetailcloudClient::UnbindNodeLabelOutcome RetailcloudClient::unbindNodeLabel(const UnbindNodeLabelRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();

View File

@@ -0,0 +1,62 @@
/*
* 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/retailcloud/model/AllocatePodConfigRequest.h>
using AlibabaCloud::Retailcloud::Model::AllocatePodConfigRequest;
AllocatePodConfigRequest::AllocatePodConfigRequest() :
RpcServiceRequest("retailcloud", "2018-03-13", "AllocatePodConfig")
{
setMethod(HttpRequest::Method::Post);
}
AllocatePodConfigRequest::~AllocatePodConfigRequest()
{}
std::string AllocatePodConfigRequest::getRequestId()const
{
return requestId_;
}
void AllocatePodConfigRequest::setRequestId(const std::string& requestId)
{
requestId_ = requestId;
setParameter("RequestId", requestId);
}
long AllocatePodConfigRequest::getAppId()const
{
return appId_;
}
void AllocatePodConfigRequest::setAppId(long appId)
{
appId_ = appId;
setParameter("AppId", std::to_string(appId));
}
long AllocatePodConfigRequest::getEnvId()const
{
return envId_;
}
void AllocatePodConfigRequest::setEnvId(long envId)
{
envId_ = envId;
setParameter("EnvId", std::to_string(envId));
}

View File

@@ -0,0 +1,73 @@
/*
* 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/retailcloud/model/AllocatePodConfigResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Retailcloud;
using namespace AlibabaCloud::Retailcloud::Model;
AllocatePodConfigResult::AllocatePodConfigResult() :
ServiceResult()
{}
AllocatePodConfigResult::AllocatePodConfigResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
AllocatePodConfigResult::~AllocatePodConfigResult()
{}
void AllocatePodConfigResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto resultNode = value["Result"];
if(!resultNode["ConfigData"].isNull())
result_.configData = resultNode["ConfigData"].asString();
if(!value["Code"].isNull())
code_ = std::stoi(value["Code"].asString());
if(!value["ErrMsg"].isNull())
errMsg_ = value["ErrMsg"].asString();
if(!value["Success"].isNull())
success_ = value["Success"].asString() == "true";
}
std::string AllocatePodConfigResult::getErrMsg()const
{
return errMsg_;
}
int AllocatePodConfigResult::getCode()const
{
return code_;
}
bool AllocatePodConfigResult::getSuccess()const
{
return success_;
}
AllocatePodConfigResult::Result AllocatePodConfigResult::getResult()const
{
return result_;
}

View File

@@ -27,17 +27,6 @@ DeployAppRequest::DeployAppRequest() :
DeployAppRequest::~DeployAppRequest()
{}
long DeployAppRequest::getDeployPacketId()const
{
return deployPacketId_;
}
void DeployAppRequest::setDeployPacketId(long deployPacketId)
{
deployPacketId_ = deployPacketId;
setParameter("DeployPacketId", std::to_string(deployPacketId));
}
std::string DeployAppRequest::getDeployPacketUrl()const
{
return deployPacketUrl_;
@@ -60,17 +49,6 @@ void DeployAppRequest::setTotalPartitions(int totalPartitions)
setParameter("TotalPartitions", std::to_string(totalPartitions));
}
std::string DeployAppRequest::getName()const
{
return name_;
}
void DeployAppRequest::setName(const std::string& name)
{
name_ = name;
setParameter("Name", name);
}
std::string DeployAppRequest::getDescription()const
{
return description_;
@@ -93,6 +71,17 @@ void DeployAppRequest::setEnvId(long envId)
setParameter("EnvId", std::to_string(envId));
}
std::string DeployAppRequest::getUpdateStrategyType()const
{
return updateStrategyType_;
}
void DeployAppRequest::setUpdateStrategyType(const std::string& updateStrategyType)
{
updateStrategyType_ = updateStrategyType;
setParameter("UpdateStrategyType", updateStrategyType);
}
std::string DeployAppRequest::getPauseType()const
{
return pauseType_;
@@ -104,6 +93,54 @@ void DeployAppRequest::setPauseType(const std::string& pauseType)
setParameter("PauseType", pauseType);
}
long DeployAppRequest::getDeployPacketId()const
{
return deployPacketId_;
}
void DeployAppRequest::setDeployPacketId(long deployPacketId)
{
deployPacketId_ = deployPacketId;
setParameter("DeployPacketId", std::to_string(deployPacketId));
}
std::vector<std::string> DeployAppRequest::getContainerImageList()const
{
return containerImageList_;
}
void DeployAppRequest::setContainerImageList(const std::vector<std::string>& containerImageList)
{
containerImageList_ = containerImageList;
for(int dep1 = 0; dep1!= containerImageList.size(); dep1++) {
setParameter("ContainerImageList."+ std::to_string(dep1), containerImageList.at(dep1));
}
}
std::string DeployAppRequest::getName()const
{
return name_;
}
void DeployAppRequest::setName(const std::string& name)
{
name_ = name;
setParameter("Name", name);
}
std::vector<std::string> DeployAppRequest::getInitContainerImageList()const
{
return initContainerImageList_;
}
void DeployAppRequest::setInitContainerImageList(const std::vector<std::string>& initContainerImageList)
{
initContainerImageList_ = initContainerImageList;
for(int dep1 = 0; dep1!= initContainerImageList.size(); dep1++) {
setParameter("InitContainerImageList."+ std::to_string(dep1), initContainerImageList.at(dep1));
}
}
bool DeployAppRequest::getArmsFlag()const
{
return armsFlag_;

View File

@@ -0,0 +1,40 @@
/*
* 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/retailcloud/model/DescribeClusterDetailRequest.h>
using AlibabaCloud::Retailcloud::Model::DescribeClusterDetailRequest;
DescribeClusterDetailRequest::DescribeClusterDetailRequest() :
RpcServiceRequest("retailcloud", "2018-03-13", "DescribeClusterDetail")
{
setMethod(HttpRequest::Method::Post);
}
DescribeClusterDetailRequest::~DescribeClusterDetailRequest()
{}
std::string DescribeClusterDetailRequest::getClusterInstanceId()const
{
return clusterInstanceId_;
}
void DescribeClusterDetailRequest::setClusterInstanceId(const std::string& clusterInstanceId)
{
clusterInstanceId_ = clusterInstanceId;
setParameter("ClusterInstanceId", clusterInstanceId);
}

View File

@@ -0,0 +1,215 @@
/*
* 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/retailcloud/model/DescribeClusterDetailResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Retailcloud;
using namespace AlibabaCloud::Retailcloud::Model;
DescribeClusterDetailResult::DescribeClusterDetailResult() :
ServiceResult()
{}
DescribeClusterDetailResult::DescribeClusterDetailResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
DescribeClusterDetailResult::~DescribeClusterDetailResult()
{}
void DescribeClusterDetailResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto resultNode = value["Result"];
auto allNodeWorkLoadListNode = resultNode["NodeWorkLoadList"]["ClusterNodeWorkLoad"];
for (auto resultNodeNodeWorkLoadListClusterNodeWorkLoad : allNodeWorkLoadListNode)
{
Result::ClusterNodeWorkLoad clusterNodeWorkLoadObject;
if(!resultNodeNodeWorkLoadListClusterNodeWorkLoad["AppPodCount"].isNull())
clusterNodeWorkLoadObject.appPodCount = std::stoi(resultNodeNodeWorkLoadListClusterNodeWorkLoad["AppPodCount"].asString());
if(!resultNodeNodeWorkLoadListClusterNodeWorkLoad["CpuRequest"].isNull())
clusterNodeWorkLoadObject.cpuRequest = resultNodeNodeWorkLoadListClusterNodeWorkLoad["CpuRequest"].asString();
if(!resultNodeNodeWorkLoadListClusterNodeWorkLoad["CpuTotal"].isNull())
clusterNodeWorkLoadObject.cpuTotal = resultNodeNodeWorkLoadListClusterNodeWorkLoad["CpuTotal"].asString();
if(!resultNodeNodeWorkLoadListClusterNodeWorkLoad["CpuUse"].isNull())
clusterNodeWorkLoadObject.cpuUse = resultNodeNodeWorkLoadListClusterNodeWorkLoad["CpuUse"].asString();
if(!resultNodeNodeWorkLoadListClusterNodeWorkLoad["InstanceId"].isNull())
clusterNodeWorkLoadObject.instanceId = resultNodeNodeWorkLoadListClusterNodeWorkLoad["InstanceId"].asString();
if(!resultNodeNodeWorkLoadListClusterNodeWorkLoad["MemRequest"].isNull())
clusterNodeWorkLoadObject.memRequest = resultNodeNodeWorkLoadListClusterNodeWorkLoad["MemRequest"].asString();
if(!resultNodeNodeWorkLoadListClusterNodeWorkLoad["MemTotal"].isNull())
clusterNodeWorkLoadObject.memTotal = resultNodeNodeWorkLoadListClusterNodeWorkLoad["MemTotal"].asString();
if(!resultNodeNodeWorkLoadListClusterNodeWorkLoad["MemUse"].isNull())
clusterNodeWorkLoadObject.memUse = resultNodeNodeWorkLoadListClusterNodeWorkLoad["MemUse"].asString();
if(!resultNodeNodeWorkLoadListClusterNodeWorkLoad["NodeName"].isNull())
clusterNodeWorkLoadObject.nodeName = resultNodeNodeWorkLoadListClusterNodeWorkLoad["NodeName"].asString();
if(!resultNodeNodeWorkLoadListClusterNodeWorkLoad["PodCount"].isNull())
clusterNodeWorkLoadObject.podCount = std::stoi(resultNodeNodeWorkLoadListClusterNodeWorkLoad["PodCount"].asString());
if(!resultNodeNodeWorkLoadListClusterNodeWorkLoad["Ready"].isNull())
clusterNodeWorkLoadObject.ready = resultNodeNodeWorkLoadListClusterNodeWorkLoad["Ready"].asString() == "true";
if(!resultNodeNodeWorkLoadListClusterNodeWorkLoad["Unschedulable"].isNull())
clusterNodeWorkLoadObject.unschedulable = resultNodeNodeWorkLoadListClusterNodeWorkLoad["Unschedulable"].asString() == "true";
result_.nodeWorkLoadList.push_back(clusterNodeWorkLoadObject);
}
auto basicInfoNode = resultNode["BasicInfo"];
if(!basicInfoNode["BusinessCode"].isNull())
result_.basicInfo.businessCode = basicInfoNode["BusinessCode"].asString();
if(!basicInfoNode["ClusterId"].isNull())
result_.basicInfo.clusterId = std::stol(basicInfoNode["ClusterId"].asString());
if(!basicInfoNode["ClusterInstanceId"].isNull())
result_.basicInfo.clusterInstanceId = basicInfoNode["ClusterInstanceId"].asString();
if(!basicInfoNode["ClusterName"].isNull())
result_.basicInfo.clusterName = basicInfoNode["ClusterName"].asString();
if(!basicInfoNode["EnvType"].isNull())
result_.basicInfo.envType = basicInfoNode["EnvType"].asString();
if(!basicInfoNode["HasInstallArmsPilot"].isNull())
result_.basicInfo.hasInstallArmsPilot = basicInfoNode["HasInstallArmsPilot"].asString() == "true";
if(!basicInfoNode["HasInstallLogController"].isNull())
result_.basicInfo.hasInstallLogController = basicInfoNode["HasInstallLogController"].asString() == "true";
if(!basicInfoNode["InstallArmsInProcess"].isNull())
result_.basicInfo.installArmsInProcess = basicInfoNode["InstallArmsInProcess"].asString() == "true";
if(!basicInfoNode["InstallLogInProcess"].isNull())
result_.basicInfo.installLogInProcess = basicInfoNode["InstallLogInProcess"].asString() == "true";
if(!basicInfoNode["MainUserId"].isNull())
result_.basicInfo.mainUserId = basicInfoNode["MainUserId"].asString();
if(!basicInfoNode["RegionId"].isNull())
result_.basicInfo.regionId = basicInfoNode["RegionId"].asString();
if(!basicInfoNode["RegionName"].isNull())
result_.basicInfo.regionName = basicInfoNode["RegionName"].asString();
if(!basicInfoNode["UserNick"].isNull())
result_.basicInfo.userNick = basicInfoNode["UserNick"].asString();
if(!basicInfoNode["VpcId"].isNull())
result_.basicInfo.vpcId = basicInfoNode["VpcId"].asString();
auto allEcsIds = basicInfoNode["EcsIds"]["String"];
for (auto value : allEcsIds)
result_.basicInfo.ecsIds.push_back(value.asString());
auto allVswitchs = basicInfoNode["Vswitchs"]["String"];
for (auto value : allVswitchs)
result_.basicInfo.vswitchs.push_back(value.asString());
auto instanceInfoNode = resultNode["InstanceInfo"];
if(!instanceInfoNode["AllocatePodCount"].isNull())
result_.instanceInfo.allocatePodCount = std::stoi(instanceInfoNode["AllocatePodCount"].asString());
if(!instanceInfoNode["AppCount"].isNull())
result_.instanceInfo.appCount = std::stoi(instanceInfoNode["AppCount"].asString());
auto allAllocatedPodInfoListNode = instanceInfoNode["AllocatedPodInfoList"]["AllocatedPodInstanceInfo"];
for (auto instanceInfoNodeAllocatedPodInfoListAllocatedPodInstanceInfo : allAllocatedPodInfoListNode)
{
Result::InstanceInfo::AllocatedPodInstanceInfo allocatedPodInstanceInfoObject;
if(!instanceInfoNodeAllocatedPodInfoListAllocatedPodInstanceInfo["AppId"].isNull())
allocatedPodInstanceInfoObject.appId = std::stol(instanceInfoNodeAllocatedPodInfoListAllocatedPodInstanceInfo["AppId"].asString());
if(!instanceInfoNodeAllocatedPodInfoListAllocatedPodInstanceInfo["AppName"].isNull())
allocatedPodInstanceInfoObject.appName = instanceInfoNodeAllocatedPodInfoListAllocatedPodInstanceInfo["AppName"].asString();
if(!instanceInfoNodeAllocatedPodInfoListAllocatedPodInstanceInfo["CupRequest"].isNull())
allocatedPodInstanceInfoObject.cupRequest = instanceInfoNodeAllocatedPodInfoListAllocatedPodInstanceInfo["CupRequest"].asString();
if(!instanceInfoNodeAllocatedPodInfoListAllocatedPodInstanceInfo["EnvId"].isNull())
allocatedPodInstanceInfoObject.envId = std::stol(instanceInfoNodeAllocatedPodInfoListAllocatedPodInstanceInfo["EnvId"].asString());
if(!instanceInfoNodeAllocatedPodInfoListAllocatedPodInstanceInfo["EnvName"].isNull())
allocatedPodInstanceInfoObject.envName = instanceInfoNodeAllocatedPodInfoListAllocatedPodInstanceInfo["EnvName"].asString();
if(!instanceInfoNodeAllocatedPodInfoListAllocatedPodInstanceInfo["MemRequest"].isNull())
allocatedPodInstanceInfoObject.memRequest = instanceInfoNodeAllocatedPodInfoListAllocatedPodInstanceInfo["MemRequest"].asString();
if(!instanceInfoNodeAllocatedPodInfoListAllocatedPodInstanceInfo["PodCount"].isNull())
allocatedPodInstanceInfoObject.podCount = std::stoi(instanceInfoNodeAllocatedPodInfoListAllocatedPodInstanceInfo["PodCount"].asString());
result_.instanceInfo.allocatedPodInfoList.push_back(allocatedPodInstanceInfoObject);
}
auto allAvailablePodInfoListNode = instanceInfoNode["AvailablePodInfoList"]["AvailablePodInstanceInfo"];
for (auto instanceInfoNodeAvailablePodInfoListAvailablePodInstanceInfo : allAvailablePodInfoListNode)
{
Result::InstanceInfo::AvailablePodInstanceInfo availablePodInstanceInfoObject;
if(!instanceInfoNodeAvailablePodInfoListAvailablePodInstanceInfo["AvailablePodCount"].isNull())
availablePodInstanceInfoObject.availablePodCount = std::stoi(instanceInfoNodeAvailablePodInfoListAvailablePodInstanceInfo["AvailablePodCount"].asString());
if(!instanceInfoNodeAvailablePodInfoListAvailablePodInstanceInfo["CupRequest"].isNull())
availablePodInstanceInfoObject.cupRequest = instanceInfoNodeAvailablePodInfoListAvailablePodInstanceInfo["CupRequest"].asString();
if(!instanceInfoNodeAvailablePodInfoListAvailablePodInstanceInfo["MemRequest"].isNull())
availablePodInstanceInfoObject.memRequest = instanceInfoNodeAvailablePodInfoListAvailablePodInstanceInfo["MemRequest"].asString();
result_.instanceInfo.availablePodInfoList.push_back(availablePodInstanceInfoObject);
}
auto netInfoNode = resultNode["NetInfo"];
if(!netInfoNode["NetPlugType"].isNull())
result_.netInfo.netPlugType = netInfoNode["NetPlugType"].asString();
if(!netInfoNode["ProdCIDR"].isNull())
result_.netInfo.prodCIDR = netInfoNode["ProdCIDR"].asString();
if(!netInfoNode["ServiceCIDR"].isNull())
result_.netInfo.serviceCIDR = netInfoNode["ServiceCIDR"].asString();
auto workLoadNode = resultNode["WorkLoad"];
if(!workLoadNode["AllNodeCount"].isNull())
result_.workLoad.allNodeCount = std::stoi(workLoadNode["AllNodeCount"].asString());
if(!workLoadNode["AllocateAllPodCount"].isNull())
result_.workLoad.allocateAllPodCount = std::stoi(workLoadNode["AllocateAllPodCount"].asString());
if(!workLoadNode["AllocateAppPodCount"].isNull())
result_.workLoad.allocateAppPodCount = std::stoi(workLoadNode["AllocateAppPodCount"].asString());
if(!workLoadNode["CpuCapacityTotal"].isNull())
result_.workLoad.cpuCapacityTotal = workLoadNode["CpuCapacityTotal"].asString();
if(!workLoadNode["CpuLevel"].isNull())
result_.workLoad.cpuLevel = workLoadNode["CpuLevel"].asString();
if(!workLoadNode["CpuRequest"].isNull())
result_.workLoad.cpuRequest = workLoadNode["CpuRequest"].asString();
if(!workLoadNode["CpuRequestPercent"].isNull())
result_.workLoad.cpuRequestPercent = workLoadNode["CpuRequestPercent"].asString();
if(!workLoadNode["CpuTotal"].isNull())
result_.workLoad.cpuTotal = workLoadNode["CpuTotal"].asString();
if(!workLoadNode["CpuUse"].isNull())
result_.workLoad.cpuUse = workLoadNode["CpuUse"].asString();
if(!workLoadNode["CpuUsePercent"].isNull())
result_.workLoad.cpuUsePercent = workLoadNode["CpuUsePercent"].asString();
if(!workLoadNode["MemCapacityTotal"].isNull())
result_.workLoad.memCapacityTotal = workLoadNode["MemCapacityTotal"].asString();
if(!workLoadNode["MemLevel"].isNull())
result_.workLoad.memLevel = workLoadNode["MemLevel"].asString();
if(!workLoadNode["MemRequest"].isNull())
result_.workLoad.memRequest = workLoadNode["MemRequest"].asString();
if(!workLoadNode["MemRequestPercent"].isNull())
result_.workLoad.memRequestPercent = workLoadNode["MemRequestPercent"].asString();
if(!workLoadNode["MemTotal"].isNull())
result_.workLoad.memTotal = workLoadNode["MemTotal"].asString();
if(!workLoadNode["MemUse"].isNull())
result_.workLoad.memUse = workLoadNode["MemUse"].asString();
if(!workLoadNode["MemUsePercent"].isNull())
result_.workLoad.memUsePercent = workLoadNode["MemUsePercent"].asString();
if(!value["Code"].isNull())
code_ = std::stoi(value["Code"].asString());
if(!value["ErrMsg"].isNull())
errMsg_ = value["ErrMsg"].asString();
if(!value["Success"].isNull())
success_ = value["Success"].asString() == "true";
}
std::string DescribeClusterDetailResult::getErrMsg()const
{
return errMsg_;
}
int DescribeClusterDetailResult::getCode()const
{
return code_;
}
bool DescribeClusterDetailResult::getSuccess()const
{
return success_;
}
DescribeClusterDetailResult::Result DescribeClusterDetailResult::getResult()const
{
return result_;
}

View File

@@ -56,16 +56,16 @@ void DescribeDatabasesResult::parse(const std::string &payload)
databasesItemObject.characterSetName = resultNodeDatabasesDatabasesItem["CharacterSetName"].asString();
if(!resultNodeDatabasesDatabasesItem["DBInstanceId"].isNull())
databasesItemObject.dBInstanceId = resultNodeDatabasesDatabasesItem["DBInstanceId"].asString();
auto allAccountsNode = allDatabasesNode["Accounts"]["AccountsItem"];
for (auto allDatabasesNodeAccountsAccountsItem : allAccountsNode)
auto allAccountsNode = resultNodeDatabasesDatabasesItem["Accounts"]["AccountsItem"];
for (auto resultNodeDatabasesDatabasesItemAccountsAccountsItem : allAccountsNode)
{
Result::DatabasesItem::AccountsItem accountsObject;
if(!allDatabasesNodeAccountsAccountsItem["AccountPrivilegeDetail"].isNull())
accountsObject.accountPrivilegeDetail = allDatabasesNodeAccountsAccountsItem["AccountPrivilegeDetail"].asString();
if(!allDatabasesNodeAccountsAccountsItem["AccountPrivilege"].isNull())
accountsObject.accountPrivilege = allDatabasesNodeAccountsAccountsItem["AccountPrivilege"].asString();
if(!allDatabasesNodeAccountsAccountsItem["Account"].isNull())
accountsObject.account = allDatabasesNodeAccountsAccountsItem["Account"].asString();
if(!resultNodeDatabasesDatabasesItemAccountsAccountsItem["AccountPrivilegeDetail"].isNull())
accountsObject.accountPrivilegeDetail = resultNodeDatabasesDatabasesItemAccountsAccountsItem["AccountPrivilegeDetail"].asString();
if(!resultNodeDatabasesDatabasesItemAccountsAccountsItem["AccountPrivilege"].isNull())
accountsObject.accountPrivilege = resultNodeDatabasesDatabasesItemAccountsAccountsItem["AccountPrivilege"].asString();
if(!resultNodeDatabasesDatabasesItemAccountsAccountsItem["Account"].isNull())
accountsObject.account = resultNodeDatabasesDatabasesItemAccountsAccountsItem["Account"].asString();
databasesItemObject.accounts.push_back(accountsObject);
}
result_.databases.push_back(databasesItemObject);

View File

@@ -56,16 +56,16 @@ void DescribeRdsAccountsResult::parse(const std::string &payload)
accountsItemObject.privExceeded = resultNodeAccountsAccountsItem["PrivExceeded"].asString();
if(!resultNodeAccountsAccountsItem["DBInstanceId"].isNull())
accountsItemObject.dBInstanceId = resultNodeAccountsAccountsItem["DBInstanceId"].asString();
auto allDatabasePrivilegesNode = allAccountsNode["DatabasePrivileges"]["DatabasePrivilegesItem"];
for (auto allAccountsNodeDatabasePrivilegesDatabasePrivilegesItem : allDatabasePrivilegesNode)
auto allDatabasePrivilegesNode = resultNodeAccountsAccountsItem["DatabasePrivileges"]["DatabasePrivilegesItem"];
for (auto resultNodeAccountsAccountsItemDatabasePrivilegesDatabasePrivilegesItem : allDatabasePrivilegesNode)
{
Result::AccountsItem::DatabasePrivilegesItem databasePrivilegesObject;
if(!allAccountsNodeDatabasePrivilegesDatabasePrivilegesItem["DBName"].isNull())
databasePrivilegesObject.dBName = allAccountsNodeDatabasePrivilegesDatabasePrivilegesItem["DBName"].asString();
if(!allAccountsNodeDatabasePrivilegesDatabasePrivilegesItem["AccountPrivilege"].isNull())
databasePrivilegesObject.accountPrivilege = allAccountsNodeDatabasePrivilegesDatabasePrivilegesItem["AccountPrivilege"].asString();
if(!allAccountsNodeDatabasePrivilegesDatabasePrivilegesItem["AccountPrivilegeDetail"].isNull())
databasePrivilegesObject.accountPrivilegeDetail = allAccountsNodeDatabasePrivilegesDatabasePrivilegesItem["AccountPrivilegeDetail"].asString();
if(!resultNodeAccountsAccountsItemDatabasePrivilegesDatabasePrivilegesItem["DBName"].isNull())
databasePrivilegesObject.dBName = resultNodeAccountsAccountsItemDatabasePrivilegesDatabasePrivilegesItem["DBName"].asString();
if(!resultNodeAccountsAccountsItemDatabasePrivilegesDatabasePrivilegesItem["AccountPrivilege"].isNull())
databasePrivilegesObject.accountPrivilege = resultNodeAccountsAccountsItemDatabasePrivilegesDatabasePrivilegesItem["AccountPrivilege"].asString();
if(!resultNodeAccountsAccountsItemDatabasePrivilegesDatabasePrivilegesItem["AccountPrivilegeDetail"].isNull())
databasePrivilegesObject.accountPrivilegeDetail = resultNodeAccountsAccountsItemDatabasePrivilegesDatabasePrivilegesItem["AccountPrivilegeDetail"].asString();
accountsItemObject.databasePrivileges.push_back(databasePrivilegesObject);
}
result_.accounts.push_back(accountsItemObject);

View File

@@ -63,16 +63,16 @@ void ListAppResult::parse(const std::string &payload)
dataObject.bizTitle = valueDataAppDetail["BizTitle"].asString();
if(!valueDataAppDetail["AppStateType"].isNull())
dataObject.appStateType = valueDataAppDetail["AppStateType"].asString();
auto allMiddleWareListNode = allDataNode["MiddleWareList"]["MiddleWareInfo"];
for (auto allDataNodeMiddleWareListMiddleWareInfo : allMiddleWareListNode)
auto allMiddleWareListNode = valueDataAppDetail["MiddleWareList"]["MiddleWareInfo"];
for (auto valueDataAppDetailMiddleWareListMiddleWareInfo : allMiddleWareListNode)
{
AppDetail::MiddleWareInfo middleWareListObject;
if(!allDataNodeMiddleWareListMiddleWareInfo["AppId"].isNull())
middleWareListObject.appId = std::stol(allDataNodeMiddleWareListMiddleWareInfo["AppId"].asString());
if(!allDataNodeMiddleWareListMiddleWareInfo["Code"].isNull())
middleWareListObject.code = std::stoi(allDataNodeMiddleWareListMiddleWareInfo["Code"].asString());
if(!allDataNodeMiddleWareListMiddleWareInfo["Name"].isNull())
middleWareListObject.name = allDataNodeMiddleWareListMiddleWareInfo["Name"].asString();
if(!valueDataAppDetailMiddleWareListMiddleWareInfo["AppId"].isNull())
middleWareListObject.appId = std::stol(valueDataAppDetailMiddleWareListMiddleWareInfo["AppId"].asString());
if(!valueDataAppDetailMiddleWareListMiddleWareInfo["Code"].isNull())
middleWareListObject.code = std::stoi(valueDataAppDetailMiddleWareListMiddleWareInfo["Code"].asString());
if(!valueDataAppDetailMiddleWareListMiddleWareInfo["Name"].isNull())
middleWareListObject.name = valueDataAppDetailMiddleWareListMiddleWareInfo["Name"].asString();
dataObject.middleWareList.push_back(middleWareListObject);
}
data_.push_back(dataObject);

View File

@@ -71,16 +71,16 @@ void ListPodsResult::parse(const std::string &payload)
dataObject.statusName = valueDataPodDetail["StatusName"].asString();
if(!valueDataPodDetail["UpdateTime"].isNull())
dataObject.updateTime = valueDataPodDetail["UpdateTime"].asString();
auto allDeployStepsNode = allDataNode["DeploySteps"]["DeployStep"];
for (auto allDataNodeDeployStepsDeployStep : allDeployStepsNode)
auto allDeployStepsNode = valueDataPodDetail["DeploySteps"]["DeployStep"];
for (auto valueDataPodDetailDeployStepsDeployStep : allDeployStepsNode)
{
PodDetail::DeployStep deployStepsObject;
if(!allDataNodeDeployStepsDeployStep["Status"].isNull())
deployStepsObject.status = allDataNodeDeployStepsDeployStep["Status"].asString();
if(!allDataNodeDeployStepsDeployStep["StepCode"].isNull())
deployStepsObject.stepCode = allDataNodeDeployStepsDeployStep["StepCode"].asString();
if(!allDataNodeDeployStepsDeployStep["StepName"].isNull())
deployStepsObject.stepName = allDataNodeDeployStepsDeployStep["StepName"].asString();
if(!valueDataPodDetailDeployStepsDeployStep["Status"].isNull())
deployStepsObject.status = valueDataPodDetailDeployStepsDeployStep["Status"].asString();
if(!valueDataPodDetailDeployStepsDeployStep["StepCode"].isNull())
deployStepsObject.stepCode = valueDataPodDetailDeployStepsDeployStep["StepCode"].asString();
if(!valueDataPodDetailDeployStepsDeployStep["StepName"].isNull())
deployStepsObject.stepName = valueDataPodDetailDeployStepsDeployStep["StepName"].asString();
dataObject.deploySteps.push_back(deployStepsObject);
}
data_.push_back(dataObject);

View File

@@ -59,20 +59,20 @@ void ListServicesResult::parse(const std::string &payload)
dataObject.serviceType = valueDataServiceInstance["ServiceType"].asString();
if(!valueDataServiceInstance["ClusterIP"].isNull())
dataObject.clusterIP = valueDataServiceInstance["ClusterIP"].asString();
auto allPortMappingsNode = allDataNode["PortMappings"]["ServicePortMapping"];
for (auto allDataNodePortMappingsServicePortMapping : allPortMappingsNode)
auto allPortMappingsNode = valueDataServiceInstance["PortMappings"]["ServicePortMapping"];
for (auto valueDataServiceInstancePortMappingsServicePortMapping : allPortMappingsNode)
{
ServiceInstance::ServicePortMapping portMappingsObject;
if(!allDataNodePortMappingsServicePortMapping["Name"].isNull())
portMappingsObject.name = allDataNodePortMappingsServicePortMapping["Name"].asString();
if(!allDataNodePortMappingsServicePortMapping["NodePort"].isNull())
portMappingsObject.nodePort = std::stoi(allDataNodePortMappingsServicePortMapping["NodePort"].asString());
if(!allDataNodePortMappingsServicePortMapping["Port"].isNull())
portMappingsObject.port = std::stoi(allDataNodePortMappingsServicePortMapping["Port"].asString());
if(!allDataNodePortMappingsServicePortMapping["Protocol"].isNull())
portMappingsObject.protocol = allDataNodePortMappingsServicePortMapping["Protocol"].asString();
if(!allDataNodePortMappingsServicePortMapping["TargetPort"].isNull())
portMappingsObject.targetPort = allDataNodePortMappingsServicePortMapping["TargetPort"].asString();
if(!valueDataServiceInstancePortMappingsServicePortMapping["Name"].isNull())
portMappingsObject.name = valueDataServiceInstancePortMappingsServicePortMapping["Name"].asString();
if(!valueDataServiceInstancePortMappingsServicePortMapping["NodePort"].isNull())
portMappingsObject.nodePort = std::stoi(valueDataServiceInstancePortMappingsServicePortMapping["NodePort"].asString());
if(!valueDataServiceInstancePortMappingsServicePortMapping["Port"].isNull())
portMappingsObject.port = std::stoi(valueDataServiceInstancePortMappingsServicePortMapping["Port"].asString());
if(!valueDataServiceInstancePortMappingsServicePortMapping["Protocol"].isNull())
portMappingsObject.protocol = valueDataServiceInstancePortMappingsServicePortMapping["Protocol"].asString();
if(!valueDataServiceInstancePortMappingsServicePortMapping["TargetPort"].isNull())
portMappingsObject.targetPort = valueDataServiceInstancePortMappingsServicePortMapping["TargetPort"].asString();
dataObject.portMappings.push_back(portMappingsObject);
}
data_.push_back(dataObject);

View File

@@ -0,0 +1,84 @@
/*
* 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/retailcloud/model/SubmitInfoRequest.h>
using AlibabaCloud::Retailcloud::Model::SubmitInfoRequest;
SubmitInfoRequest::SubmitInfoRequest() :
RpcServiceRequest("retailcloud", "2018-03-13", "SubmitInfo")
{
setMethod(HttpRequest::Method::Post);
}
SubmitInfoRequest::~SubmitInfoRequest()
{}
std::string SubmitInfoRequest::getRequestId()const
{
return requestId_;
}
void SubmitInfoRequest::setRequestId(const std::string& requestId)
{
requestId_ = requestId;
setParameter("RequestId", requestId);
}
long SubmitInfoRequest::getMainUserId()const
{
return mainUserId_;
}
void SubmitInfoRequest::setMainUserId(long mainUserId)
{
mainUserId_ = mainUserId;
setParameter("MainUserId", std::to_string(mainUserId));
}
std::vector<SubmitInfoRequest::EcsDescList> SubmitInfoRequest::getEcsDescList()const
{
return ecsDescList_;
}
void SubmitInfoRequest::setEcsDescList(const std::vector<EcsDescList>& ecsDescList)
{
ecsDescList_ = ecsDescList;
for(int dep1 = 0; dep1!= ecsDescList.size(); dep1++) {
auto ecsDescListObj = ecsDescList.at(dep1);
std::string ecsDescListObjStr = "EcsDescList." + std::to_string(dep1 + 1);
setParameter(ecsDescListObjStr + ".ResourceId", ecsDescListObj.resourceId);
setParameter(ecsDescListObjStr + ".BussinessDesc", ecsDescListObj.bussinessDesc);
setParameter(ecsDescListObjStr + ".MiddleWareDesc", ecsDescListObj.middleWareDesc);
setParameter(ecsDescListObjStr + ".OtherMiddleWareDesc", ecsDescListObj.otherMiddleWareDesc);
setParameter(ecsDescListObjStr + ".BussinessType", ecsDescListObj.bussinessType);
setParameter(ecsDescListObjStr + ".AppType", ecsDescListObj.appType);
setParameter(ecsDescListObjStr + ".EnvType", ecsDescListObj.envType);
setParameter(ecsDescListObjStr + ".UserId", ecsDescListObj.userId);
}
}
long SubmitInfoRequest::getCallerUid()const
{
return callerUid_;
}
void SubmitInfoRequest::setCallerUid(long callerUid)
{
callerUid_ = callerUid;
setParameter("CallerUid", std::to_string(callerUid));
}

View File

@@ -0,0 +1,65 @@
/*
* 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/retailcloud/model/SubmitInfoResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Retailcloud;
using namespace AlibabaCloud::Retailcloud::Model;
SubmitInfoResult::SubmitInfoResult() :
ServiceResult()
{}
SubmitInfoResult::SubmitInfoResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
SubmitInfoResult::~SubmitInfoResult()
{}
void SubmitInfoResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
if(!value["Code"].isNull())
code_ = std::stoi(value["Code"].asString());
if(!value["ErrMsg"].isNull())
errMsg_ = value["ErrMsg"].asString();
if(!value["Success"].isNull())
success_ = value["Success"].asString() == "true";
}
std::string SubmitInfoResult::getErrMsg()const
{
return errMsg_;
}
int SubmitInfoResult::getCode()const
{
return code_;
}
bool SubmitInfoResult::getSuccess()const
{
return success_;
}

View File

@@ -0,0 +1,95 @@
/*
* 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/retailcloud/model/SyncPodInfoRequest.h>
using AlibabaCloud::Retailcloud::Model::SyncPodInfoRequest;
SyncPodInfoRequest::SyncPodInfoRequest() :
RpcServiceRequest("retailcloud", "2018-03-13", "SyncPodInfo")
{
setMethod(HttpRequest::Method::Post);
}
SyncPodInfoRequest::~SyncPodInfoRequest()
{}
std::string SyncPodInfoRequest::getReason()const
{
return reason_;
}
void SyncPodInfoRequest::setReason(const std::string& reason)
{
reason_ = reason;
setParameter("Reason", reason);
}
std::string SyncPodInfoRequest::getRequestId()const
{
return requestId_;
}
void SyncPodInfoRequest::setRequestId(const std::string& requestId)
{
requestId_ = requestId;
setParameter("RequestId", requestId);
}
std::string SyncPodInfoRequest::getPodName()const
{
return podName_;
}
void SyncPodInfoRequest::setPodName(const std::string& podName)
{
podName_ = podName;
setParameter("PodName", podName);
}
std::string SyncPodInfoRequest::getSideCarType()const
{
return sideCarType_;
}
void SyncPodInfoRequest::setSideCarType(const std::string& sideCarType)
{
sideCarType_ = sideCarType;
setParameter("SideCarType", sideCarType);
}
long SyncPodInfoRequest::getTaskId()const
{
return taskId_;
}
void SyncPodInfoRequest::setTaskId(long taskId)
{
taskId_ = taskId;
setParameter("TaskId", std::to_string(taskId));
}
bool SyncPodInfoRequest::getStatus()const
{
return status_;
}
void SyncPodInfoRequest::setStatus(bool status)
{
status_ = status;
setParameter("Status", status ? "true" : "false");
}

View File

@@ -0,0 +1,66 @@
/*
* 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/retailcloud/model/SyncPodInfoResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Retailcloud;
using namespace AlibabaCloud::Retailcloud::Model;
SyncPodInfoResult::SyncPodInfoResult() :
ServiceResult()
{}
SyncPodInfoResult::SyncPodInfoResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
SyncPodInfoResult::~SyncPodInfoResult()
{}
void SyncPodInfoResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto resultNode = value["Result"];
if(!resultNode["Success"].isNull())
result_.success = resultNode["Success"].asString() == "true";
if(!value["Code"].isNull())
code_ = std::stoi(value["Code"].asString());
if(!value["ErrMsg"].isNull())
errMsg_ = value["ErrMsg"].asString();
}
std::string SyncPodInfoResult::getErrMsg()const
{
return errMsg_;
}
int SyncPodInfoResult::getCode()const
{
return code_;
}
SyncPodInfoResult::Result SyncPodInfoResult::getResult()const
{
return result_;
}