Init.
This commit is contained in:
118
metering/src/model/SyncDataRequest.cc
Normal file
118
metering/src/model/SyncDataRequest.cc
Normal file
@@ -0,0 +1,118 @@
|
||||
/*
|
||||
* 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/metering/model/SyncDataRequest.h>
|
||||
|
||||
using AlibabaCloud::Metering::Model::SyncDataRequest;
|
||||
|
||||
SyncDataRequest::SyncDataRequest() :
|
||||
RoaServiceRequest("metering", "2020-09-21")
|
||||
{
|
||||
setResourcePath("/api/dataSync");
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
SyncDataRequest::~SyncDataRequest()
|
||||
{}
|
||||
|
||||
std::string SyncDataRequest::getInstanceId()const
|
||||
{
|
||||
return instanceId_;
|
||||
}
|
||||
|
||||
void SyncDataRequest::setInstanceId(const std::string& instanceId)
|
||||
{
|
||||
instanceId_ = instanceId;
|
||||
setParameter("InstanceId", instanceId);
|
||||
}
|
||||
|
||||
std::string SyncDataRequest::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
void SyncDataRequest::setData(const std::string& data)
|
||||
{
|
||||
data_ = data;
|
||||
setParameter("Data", data);
|
||||
}
|
||||
|
||||
std::string SyncDataRequest::getDataType()const
|
||||
{
|
||||
return dataType_;
|
||||
}
|
||||
|
||||
void SyncDataRequest::setDataType(const std::string& dataType)
|
||||
{
|
||||
dataType_ = dataType;
|
||||
setParameter("DataType", dataType);
|
||||
}
|
||||
|
||||
std::string SyncDataRequest::getEndTime()const
|
||||
{
|
||||
return endTime_;
|
||||
}
|
||||
|
||||
void SyncDataRequest::setEndTime(const std::string& endTime)
|
||||
{
|
||||
endTime_ = endTime;
|
||||
setParameter("EndTime", endTime);
|
||||
}
|
||||
|
||||
std::string SyncDataRequest::getStartTime()const
|
||||
{
|
||||
return startTime_;
|
||||
}
|
||||
|
||||
void SyncDataRequest::setStartTime(const std::string& startTime)
|
||||
{
|
||||
startTime_ = startTime;
|
||||
setParameter("StartTime", startTime);
|
||||
}
|
||||
|
||||
std::string SyncDataRequest::getCommodityCode()const
|
||||
{
|
||||
return commodityCode_;
|
||||
}
|
||||
|
||||
void SyncDataRequest::setCommodityCode(const std::string& commodityCode)
|
||||
{
|
||||
commodityCode_ = commodityCode;
|
||||
setParameter("CommodityCode", commodityCode);
|
||||
}
|
||||
|
||||
std::string SyncDataRequest::getRegion()const
|
||||
{
|
||||
return region_;
|
||||
}
|
||||
|
||||
void SyncDataRequest::setRegion(const std::string& region)
|
||||
{
|
||||
region_ = region;
|
||||
setParameter("Region", region);
|
||||
}
|
||||
|
||||
std::string SyncDataRequest::getUserId()const
|
||||
{
|
||||
return userId_;
|
||||
}
|
||||
|
||||
void SyncDataRequest::setUserId(const std::string& userId)
|
||||
{
|
||||
userId_ = userId;
|
||||
setParameter("UserId", userId);
|
||||
}
|
||||
|
||||
79
metering/src/model/SyncDataResult.cc
Normal file
79
metering/src/model/SyncDataResult.cc
Normal file
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
* 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/metering/model/SyncDataResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Metering;
|
||||
using namespace AlibabaCloud::Metering::Model;
|
||||
|
||||
SyncDataResult::SyncDataResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
SyncDataResult::SyncDataResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
SyncDataResult::~SyncDataResult()
|
||||
{}
|
||||
|
||||
void SyncDataResult::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["Success"].isNull())
|
||||
success_ = value["Success"].asString() == "true";
|
||||
if(!value["Data"].isNull())
|
||||
data_ = value["Data"].asString() == "true";
|
||||
if(!value["ErrCode"].isNull())
|
||||
errCode_ = std::stoi(value["ErrCode"].asString());
|
||||
if(!value["ErrMessage"].isNull())
|
||||
errMessage_ = value["ErrMessage"].asString();
|
||||
|
||||
}
|
||||
|
||||
bool SyncDataResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
std::string SyncDataResult::getErrMessage()const
|
||||
{
|
||||
return errMessage_;
|
||||
}
|
||||
|
||||
int SyncDataResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
bool SyncDataResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
int SyncDataResult::getErrCode()const
|
||||
{
|
||||
return errCode_;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user