Iot_20180120 Old sdk.

This commit is contained in:
sdk-team
2022-08-25 07:38:12 +00:00
parent fb7804f7b0
commit e1a6fce136
16 changed files with 1285 additions and 1 deletions

View File

@@ -2283,6 +2283,42 @@ IotClient::CreateDeviceTunnelOutcomeCallable IotClient::createDeviceTunnelCallab
return task->get_future();
}
IotClient::CreateDownloadDataJobOutcome IotClient::createDownloadDataJob(const CreateDownloadDataJobRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return CreateDownloadDataJobOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return CreateDownloadDataJobOutcome(CreateDownloadDataJobResult(outcome.result()));
else
return CreateDownloadDataJobOutcome(outcome.error());
}
void IotClient::createDownloadDataJobAsync(const CreateDownloadDataJobRequest& request, const CreateDownloadDataJobAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, createDownloadDataJob(request), context);
};
asyncExecute(new Runnable(fn));
}
IotClient::CreateDownloadDataJobOutcomeCallable IotClient::createDownloadDataJobCallable(const CreateDownloadDataJobRequest &request) const
{
auto task = std::make_shared<std::packaged_task<CreateDownloadDataJobOutcome()>>(
[this, request]()
{
return this->createDownloadDataJob(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
IotClient::CreateEdgeDriverOutcome IotClient::createEdgeDriver(const CreateEdgeDriverRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -5487,6 +5523,42 @@ IotClient::GetDeviceTunnelStatusOutcomeCallable IotClient::getDeviceTunnelStatus
return task->get_future();
}
IotClient::GetDownloadFileOutcome IotClient::getDownloadFile(const GetDownloadFileRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return GetDownloadFileOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return GetDownloadFileOutcome(GetDownloadFileResult(outcome.result()));
else
return GetDownloadFileOutcome(outcome.error());
}
void IotClient::getDownloadFileAsync(const GetDownloadFileRequest& request, const GetDownloadFileAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, getDownloadFile(request), context);
};
asyncExecute(new Runnable(fn));
}
IotClient::GetDownloadFileOutcomeCallable IotClient::getDownloadFileCallable(const GetDownloadFileRequest &request) const
{
auto task = std::make_shared<std::packaged_task<GetDownloadFileOutcome()>>(
[this, request]()
{
return this->getDownloadFile(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
IotClient::GetEdgeDriverVersionOutcome IotClient::getEdgeDriverVersion(const GetEdgeDriverVersionRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -9051,6 +9123,42 @@ IotClient::QueryDeviceStatisticsOutcomeCallable IotClient::queryDeviceStatistics
return task->get_future();
}
IotClient::QueryDeviceSubTopicOutcome IotClient::queryDeviceSubTopic(const QueryDeviceSubTopicRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return QueryDeviceSubTopicOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return QueryDeviceSubTopicOutcome(QueryDeviceSubTopicResult(outcome.result()));
else
return QueryDeviceSubTopicOutcome(outcome.error());
}
void IotClient::queryDeviceSubTopicAsync(const QueryDeviceSubTopicRequest& request, const QueryDeviceSubTopicAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, queryDeviceSubTopic(request), context);
};
asyncExecute(new Runnable(fn));
}
IotClient::QueryDeviceSubTopicOutcomeCallable IotClient::queryDeviceSubTopicCallable(const QueryDeviceSubTopicRequest &request) const
{
auto task = std::make_shared<std::packaged_task<QueryDeviceSubTopicOutcome()>>(
[this, request]()
{
return this->queryDeviceSubTopic(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
IotClient::QueryDeviceTunnelOutcome IotClient::queryDeviceTunnel(const QueryDeviceTunnelRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();

View File

@@ -0,0 +1,128 @@
/*
* 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/iot/model/CreateDownloadDataJobRequest.h>
using AlibabaCloud::Iot::Model::CreateDownloadDataJobRequest;
CreateDownloadDataJobRequest::CreateDownloadDataJobRequest() :
RpcServiceRequest("iot", "2018-01-20", "CreateDownloadDataJob")
{
setMethod(HttpRequest::Method::Post);
}
CreateDownloadDataJobRequest::~CreateDownloadDataJobRequest()
{}
long CreateDownloadDataJobRequest::getStartTime()const
{
return startTime_;
}
void CreateDownloadDataJobRequest::setStartTime(long startTime)
{
startTime_ = startTime;
setParameter("StartTime", std::to_string(startTime));
}
std::string CreateDownloadDataJobRequest::getFileConfig()const
{
return fileConfig_;
}
void CreateDownloadDataJobRequest::setFileConfig(const std::string& fileConfig)
{
fileConfig_ = fileConfig;
setParameter("FileConfig", fileConfig);
}
std::string CreateDownloadDataJobRequest::getIotInstanceId()const
{
return iotInstanceId_;
}
void CreateDownloadDataJobRequest::setIotInstanceId(const std::string& iotInstanceId)
{
iotInstanceId_ = iotInstanceId;
setBodyParameter("IotInstanceId", iotInstanceId);
}
std::string CreateDownloadDataJobRequest::getContext()const
{
return context_;
}
void CreateDownloadDataJobRequest::setContext(const std::string& context)
{
context_ = context;
setBodyParameter("Context", context);
}
std::string CreateDownloadDataJobRequest::getTableName()const
{
return tableName_;
}
void CreateDownloadDataJobRequest::setTableName(const std::string& tableName)
{
tableName_ = tableName;
setParameter("TableName", tableName);
}
long CreateDownloadDataJobRequest::getEndTime()const
{
return endTime_;
}
void CreateDownloadDataJobRequest::setEndTime(long endTime)
{
endTime_ = endTime;
setParameter("EndTime", std::to_string(endTime));
}
std::string CreateDownloadDataJobRequest::getDownloadDataType()const
{
return downloadDataType_;
}
void CreateDownloadDataJobRequest::setDownloadDataType(const std::string& downloadDataType)
{
downloadDataType_ = downloadDataType;
setParameter("DownloadDataType", downloadDataType);
}
std::string CreateDownloadDataJobRequest::getApiProduct()const
{
return apiProduct_;
}
void CreateDownloadDataJobRequest::setApiProduct(const std::string& apiProduct)
{
apiProduct_ = apiProduct;
setBodyParameter("ApiProduct", apiProduct);
}
std::string CreateDownloadDataJobRequest::getApiRevision()const
{
return apiRevision_;
}
void CreateDownloadDataJobRequest::setApiRevision(const std::string& apiRevision)
{
apiRevision_ = apiRevision;
setBodyParameter("ApiRevision", apiRevision);
}

View File

@@ -0,0 +1,148 @@
/*
* 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/iot/model/CreateDownloadDataJobResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Iot;
using namespace AlibabaCloud::Iot::Model;
CreateDownloadDataJobResult::CreateDownloadDataJobResult() :
ServiceResult()
{}
CreateDownloadDataJobResult::CreateDownloadDataJobResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
CreateDownloadDataJobResult::~CreateDownloadDataJobResult()
{}
void CreateDownloadDataJobResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto dataNode = value["Data"];
if(!dataNode["PreviewSize"].isNull())
data_.previewSize = std::stoi(dataNode["PreviewSize"].asString());
if(!dataNode["CsvUrl"].isNull())
data_.csvUrl = dataNode["CsvUrl"].asString();
if(!dataNode["DatasetId"].isNull())
data_.datasetId = dataNode["DatasetId"].asString();
if(!dataNode["LongJobId"].isNull())
data_.longJobId = dataNode["LongJobId"].asString();
if(!dataNode["Status"].isNull())
data_.status = std::stoi(dataNode["Status"].asString());
if(!dataNode["BeginTime"].isNull())
data_.beginTime = std::stol(dataNode["BeginTime"].asString());
if(!dataNode["EndTime"].isNull())
data_.endTime = std::stol(dataNode["EndTime"].asString());
if(!dataNode["ResultDataInString"].isNull())
data_.resultDataInString = dataNode["ResultDataInString"].asString();
if(!dataNode["AsyncExecute"].isNull())
data_.asyncExecute = dataNode["AsyncExecute"].asString() == "true";
if(!dataNode["TotalCount"].isNull())
data_.totalCount = std::stol(dataNode["TotalCount"].asString());
if(!dataNode["PageNo"].isNull())
data_.pageNo = std::stoi(dataNode["PageNo"].asString());
if(!dataNode["PageSize"].isNull())
data_.pageSize = std::stoi(dataNode["PageSize"].asString());
if(!dataNode["CsvFileName"].isNull())
data_.csvFileName = dataNode["CsvFileName"].asString();
auto allHeaderNode = dataNode["Header"]["HeaderItem"];
for (auto dataNodeHeaderHeaderItem : allHeaderNode)
{
Data::HeaderItem headerItemObject;
if(!dataNodeHeaderHeaderItem["FieldName"].isNull())
headerItemObject.fieldName = dataNodeHeaderHeaderItem["FieldName"].asString();
if(!dataNodeHeaderHeaderItem["Alias"].isNull())
headerItemObject.alias = dataNodeHeaderHeaderItem["Alias"].asString();
if(!dataNodeHeaderHeaderItem["FieldType"].isNull())
headerItemObject.fieldType = dataNodeHeaderHeaderItem["FieldType"].asString();
if(!dataNodeHeaderHeaderItem["TypeClass"].isNull())
headerItemObject.typeClass = dataNodeHeaderHeaderItem["TypeClass"].asString();
if(!dataNodeHeaderHeaderItem["TimeClass"].isNull())
headerItemObject.timeClass = dataNodeHeaderHeaderItem["TimeClass"].asString();
if(!dataNodeHeaderHeaderItem["GeoClass"].isNull())
headerItemObject.geoClass = dataNodeHeaderHeaderItem["GeoClass"].asString();
if(!dataNodeHeaderHeaderItem["DimDateClass"].isNull())
headerItemObject.dimDateClass = dataNodeHeaderHeaderItem["DimDateClass"].asString();
if(!dataNodeHeaderHeaderItem["DataPrecision"].isNull())
headerItemObject.dataPrecision = dataNodeHeaderHeaderItem["DataPrecision"].asString();
data_.header.push_back(headerItemObject);
}
auto querySettingNode = dataNode["QuerySetting"];
auto allSelectedHeadersNode = querySettingNode["SelectedHeaders"]["SelectedHeadersItem"];
for (auto querySettingNodeSelectedHeadersSelectedHeadersItem : allSelectedHeadersNode)
{
Data::QuerySetting::SelectedHeadersItem selectedHeadersItemObject;
if(!querySettingNodeSelectedHeadersSelectedHeadersItem["FieldName"].isNull())
selectedHeadersItemObject.fieldName = querySettingNodeSelectedHeadersSelectedHeadersItem["FieldName"].asString();
if(!querySettingNodeSelectedHeadersSelectedHeadersItem["Alias"].isNull())
selectedHeadersItemObject.alias = querySettingNodeSelectedHeadersSelectedHeadersItem["Alias"].asString();
if(!querySettingNodeSelectedHeadersSelectedHeadersItem["FieldType"].isNull())
selectedHeadersItemObject.fieldType = querySettingNodeSelectedHeadersSelectedHeadersItem["FieldType"].asString();
if(!querySettingNodeSelectedHeadersSelectedHeadersItem["TimeClass"].isNull())
selectedHeadersItemObject.timeClass = querySettingNodeSelectedHeadersSelectedHeadersItem["TimeClass"].asString();
if(!querySettingNodeSelectedHeadersSelectedHeadersItem["GeoClass"].isNull())
selectedHeadersItemObject.geoClass = querySettingNodeSelectedHeadersSelectedHeadersItem["GeoClass"].asString();
if(!querySettingNodeSelectedHeadersSelectedHeadersItem["DimDateClass"].isNull())
selectedHeadersItemObject.dimDateClass = querySettingNodeSelectedHeadersSelectedHeadersItem["DimDateClass"].asString();
data_.querySetting.selectedHeaders.push_back(selectedHeadersItemObject);
}
auto allAstExprNode = querySettingNode["AstExpr"]["AstExprItem"];
for (auto querySettingNodeAstExprAstExprItem : allAstExprNode)
{
Data::QuerySetting::AstExprItem astExprItemObject;
if(!querySettingNodeAstExprAstExprItem["Expr"].isNull())
astExprItemObject.expr = querySettingNodeAstExprAstExprItem["Expr"].asString();
if(!querySettingNodeAstExprAstExprItem["ExprType"].isNull())
astExprItemObject.exprType = querySettingNodeAstExprAstExprItem["ExprType"].asString();
data_.querySetting.astExpr.push_back(astExprItemObject);
}
if(!value["Success"].isNull())
success_ = value["Success"].asString() == "true";
if(!value["Code"].isNull())
code_ = value["Code"].asString();
if(!value["ErrorMessage"].isNull())
errorMessage_ = value["ErrorMessage"].asString();
}
CreateDownloadDataJobResult::Data CreateDownloadDataJobResult::getData()const
{
return data_;
}
std::string CreateDownloadDataJobResult::getErrorMessage()const
{
return errorMessage_;
}
std::string CreateDownloadDataJobResult::getCode()const
{
return code_;
}
bool CreateDownloadDataJobResult::getSuccess()const
{
return success_;
}

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/iot/model/GetDownloadFileRequest.h>
using AlibabaCloud::Iot::Model::GetDownloadFileRequest;
GetDownloadFileRequest::GetDownloadFileRequest() :
RpcServiceRequest("iot", "2018-01-20", "GetDownloadFile")
{
setMethod(HttpRequest::Method::Post);
}
GetDownloadFileRequest::~GetDownloadFileRequest()
{}
std::string GetDownloadFileRequest::getIotInstanceId()const
{
return iotInstanceId_;
}
void GetDownloadFileRequest::setIotInstanceId(const std::string& iotInstanceId)
{
iotInstanceId_ = iotInstanceId;
setBodyParameter("IotInstanceId", iotInstanceId);
}
std::string GetDownloadFileRequest::getContext()const
{
return context_;
}
void GetDownloadFileRequest::setContext(const std::string& context)
{
context_ = context;
setBodyParameter("Context", context);
}
std::string GetDownloadFileRequest::getLongJobId()const
{
return longJobId_;
}
void GetDownloadFileRequest::setLongJobId(const std::string& longJobId)
{
longJobId_ = longJobId;
setParameter("LongJobId", longJobId);
}
std::string GetDownloadFileRequest::getApiProduct()const
{
return apiProduct_;
}
void GetDownloadFileRequest::setApiProduct(const std::string& apiProduct)
{
apiProduct_ = apiProduct;
setBodyParameter("ApiProduct", apiProduct);
}
std::string GetDownloadFileRequest::getApiRevision()const
{
return apiRevision_;
}
void GetDownloadFileRequest::setApiRevision(const std::string& apiRevision)
{
apiRevision_ = apiRevision;
setBodyParameter("ApiRevision", apiRevision);
}

View File

@@ -0,0 +1,151 @@
/*
* 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/iot/model/GetDownloadFileResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Iot;
using namespace AlibabaCloud::Iot::Model;
GetDownloadFileResult::GetDownloadFileResult() :
ServiceResult()
{}
GetDownloadFileResult::GetDownloadFileResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
GetDownloadFileResult::~GetDownloadFileResult()
{}
void GetDownloadFileResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto dataNode = value["Data"];
if(!dataNode["PreviewSize"].isNull())
data_.previewSize = std::stoi(dataNode["PreviewSize"].asString());
if(!dataNode["CsvUrl"].isNull())
data_.csvUrl = dataNode["CsvUrl"].asString();
if(!dataNode["DatasetId"].isNull())
data_.datasetId = dataNode["DatasetId"].asString();
if(!dataNode["LongJobId"].isNull())
data_.longJobId = dataNode["LongJobId"].asString();
if(!dataNode["Status"].isNull())
data_.status = std::stoi(dataNode["Status"].asString());
if(!dataNode["BeginTime"].isNull())
data_.beginTime = std::stol(dataNode["BeginTime"].asString());
if(!dataNode["EndTime"].isNull())
data_.endTime = std::stol(dataNode["EndTime"].asString());
if(!dataNode["ResultDataInString"].isNull())
data_.resultDataInString = dataNode["ResultDataInString"].asString();
if(!dataNode["AsyncExecute"].isNull())
data_.asyncExecute = dataNode["AsyncExecute"].asString() == "true";
if(!dataNode["TotalCount"].isNull())
data_.totalCount = std::stol(dataNode["TotalCount"].asString());
if(!dataNode["PageNo"].isNull())
data_.pageNo = std::stoi(dataNode["PageNo"].asString());
if(!dataNode["PageSize"].isNull())
data_.pageSize = std::stoi(dataNode["PageSize"].asString());
if(!dataNode["CsvUrl"].isNull())
data_.csvUrl1 = dataNode["CsvUrl"].asString();
if(!dataNode["CsvFileName"].isNull())
data_.csvFileName = dataNode["CsvFileName"].asString();
auto allHeaderNode = dataNode["Header"]["HeaderItem"];
for (auto dataNodeHeaderHeaderItem : allHeaderNode)
{
Data::HeaderItem headerItemObject;
if(!dataNodeHeaderHeaderItem["FieldName"].isNull())
headerItemObject.fieldName = dataNodeHeaderHeaderItem["FieldName"].asString();
if(!dataNodeHeaderHeaderItem["Alias"].isNull())
headerItemObject.alias = dataNodeHeaderHeaderItem["Alias"].asString();
if(!dataNodeHeaderHeaderItem["FieldType"].isNull())
headerItemObject.fieldType = dataNodeHeaderHeaderItem["FieldType"].asString();
if(!dataNodeHeaderHeaderItem["TypeClass"].isNull())
headerItemObject.typeClass = dataNodeHeaderHeaderItem["TypeClass"].asString();
if(!dataNodeHeaderHeaderItem["TimeClass"].isNull())
headerItemObject.timeClass = dataNodeHeaderHeaderItem["TimeClass"].asString();
if(!dataNodeHeaderHeaderItem["GeoClass"].isNull())
headerItemObject.geoClass = dataNodeHeaderHeaderItem["GeoClass"].asString();
if(!dataNodeHeaderHeaderItem["DimDateClass"].isNull())
headerItemObject.dimDateClass = dataNodeHeaderHeaderItem["DimDateClass"].asString();
data_.header.push_back(headerItemObject);
}
auto querySettingNode = dataNode["QuerySetting"];
auto allSelectedHeadersNode = querySettingNode["SelectedHeaders"]["SelectedHeadersItem"];
for (auto querySettingNodeSelectedHeadersSelectedHeadersItem : allSelectedHeadersNode)
{
Data::QuerySetting::SelectedHeadersItem selectedHeadersItemObject;
if(!querySettingNodeSelectedHeadersSelectedHeadersItem["FieldName"].isNull())
selectedHeadersItemObject.fieldName = querySettingNodeSelectedHeadersSelectedHeadersItem["FieldName"].asString();
if(!querySettingNodeSelectedHeadersSelectedHeadersItem["Alias"].isNull())
selectedHeadersItemObject.alias = querySettingNodeSelectedHeadersSelectedHeadersItem["Alias"].asString();
if(!querySettingNodeSelectedHeadersSelectedHeadersItem["FieldType"].isNull())
selectedHeadersItemObject.fieldType = querySettingNodeSelectedHeadersSelectedHeadersItem["FieldType"].asString();
if(!querySettingNodeSelectedHeadersSelectedHeadersItem["TimeClass"].isNull())
selectedHeadersItemObject.timeClass = querySettingNodeSelectedHeadersSelectedHeadersItem["TimeClass"].asString();
if(!querySettingNodeSelectedHeadersSelectedHeadersItem["GeoClass"].isNull())
selectedHeadersItemObject.geoClass = querySettingNodeSelectedHeadersSelectedHeadersItem["GeoClass"].asString();
if(!querySettingNodeSelectedHeadersSelectedHeadersItem["DimDateClass"].isNull())
selectedHeadersItemObject.dimDateClass = querySettingNodeSelectedHeadersSelectedHeadersItem["DimDateClass"].asString();
data_.querySetting.selectedHeaders.push_back(selectedHeadersItemObject);
}
auto allAstExprNode = querySettingNode["AstExpr"]["AstExprItem"];
for (auto querySettingNodeAstExprAstExprItem : allAstExprNode)
{
Data::QuerySetting::AstExprItem astExprItemObject;
if(!querySettingNodeAstExprAstExprItem["Expr"].isNull())
astExprItemObject.expr = querySettingNodeAstExprAstExprItem["Expr"].asString();
if(!querySettingNodeAstExprAstExprItem["ExprType"].isNull())
astExprItemObject.exprType = querySettingNodeAstExprAstExprItem["ExprType"].asString();
data_.querySetting.astExpr.push_back(astExprItemObject);
}
auto allResult = dataNode["Result"]["Result"];
for (auto value : allResult)
data_.result.push_back(value.asString());
if(!value["Success"].isNull())
success_ = value["Success"].asString() == "true";
if(!value["Code"].isNull())
code_ = value["Code"].asString();
if(!value["ErrorMessage"].isNull())
errorMessage_ = value["ErrorMessage"].asString();
}
GetDownloadFileResult::Data GetDownloadFileResult::getData()const
{
return data_;
}
std::string GetDownloadFileResult::getErrorMessage()const
{
return errorMessage_;
}
std::string GetDownloadFileResult::getCode()const
{
return code_;
}
bool GetDownloadFileResult::getSuccess()const
{
return success_;
}

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/iot/model/QueryDeviceSubTopicRequest.h>
using AlibabaCloud::Iot::Model::QueryDeviceSubTopicRequest;
QueryDeviceSubTopicRequest::QueryDeviceSubTopicRequest() :
RpcServiceRequest("iot", "2018-01-20", "QueryDeviceSubTopic")
{
setMethod(HttpRequest::Method::Post);
}
QueryDeviceSubTopicRequest::~QueryDeviceSubTopicRequest()
{}
std::string QueryDeviceSubTopicRequest::getIotInstanceId()const
{
return iotInstanceId_;
}
void QueryDeviceSubTopicRequest::setIotInstanceId(const std::string& iotInstanceId)
{
iotInstanceId_ = iotInstanceId;
setParameter("IotInstanceId", iotInstanceId);
}
std::string QueryDeviceSubTopicRequest::getProductKey()const
{
return productKey_;
}
void QueryDeviceSubTopicRequest::setProductKey(const std::string& productKey)
{
productKey_ = productKey;
setParameter("ProductKey", productKey);
}
std::string QueryDeviceSubTopicRequest::getApiProduct()const
{
return apiProduct_;
}
void QueryDeviceSubTopicRequest::setApiProduct(const std::string& apiProduct)
{
apiProduct_ = apiProduct;
setBodyParameter("ApiProduct", apiProduct);
}
std::string QueryDeviceSubTopicRequest::getApiRevision()const
{
return apiRevision_;
}
void QueryDeviceSubTopicRequest::setApiRevision(const std::string& apiRevision)
{
apiRevision_ = apiRevision;
setBodyParameter("ApiRevision", apiRevision);
}
std::string QueryDeviceSubTopicRequest::getDeviceName()const
{
return deviceName_;
}
void QueryDeviceSubTopicRequest::setDeviceName(const std::string& deviceName)
{
deviceName_ = deviceName;
setParameter("DeviceName", deviceName);
}

View File

@@ -0,0 +1,80 @@
/*
* 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/iot/model/QueryDeviceSubTopicResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Iot;
using namespace AlibabaCloud::Iot::Model;
QueryDeviceSubTopicResult::QueryDeviceSubTopicResult() :
ServiceResult()
{}
QueryDeviceSubTopicResult::QueryDeviceSubTopicResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
QueryDeviceSubTopicResult::~QueryDeviceSubTopicResult()
{}
void QueryDeviceSubTopicResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto allTopicListNode = value["TopicList"]["topic"];
for (auto valueTopicListtopic : allTopicListNode)
{
Topic topicListObject;
if(!valueTopicListtopic["TopicName"].isNull())
topicListObject.topicName = valueTopicListtopic["TopicName"].asString();
if(!valueTopicListtopic["Timestamp"].isNull())
topicListObject.timestamp = std::stol(valueTopicListtopic["Timestamp"].asString());
topicList_.push_back(topicListObject);
}
if(!value["Success"].isNull())
success_ = value["Success"].asString() == "true";
if(!value["Code"].isNull())
code_ = value["Code"].asString();
if(!value["ErrorMessage"].isNull())
errorMessage_ = value["ErrorMessage"].asString();
}
std::vector<QueryDeviceSubTopicResult::Topic> QueryDeviceSubTopicResult::getTopicList()const
{
return topicList_;
}
std::string QueryDeviceSubTopicResult::getErrorMessage()const
{
return errorMessage_;
}
std::string QueryDeviceSubTopicResult::getCode()const
{
return code_;
}
bool QueryDeviceSubTopicResult::getSuccess()const
{
return success_;
}