Update OTA API, including CreateOTADynamicUpgradeJob,CreateOTAStaticUpgradeJob,QueryOTAJob.
This commit is contained in:
@@ -5883,42 +5883,6 @@ IotClient::ListRuleActionsOutcomeCallable IotClient::listRuleActionsCallable(con
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
IotClient::ListSourceReplicaOutcome IotClient::listSourceReplica(const ListSourceReplicaRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return ListSourceReplicaOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return ListSourceReplicaOutcome(ListSourceReplicaResult(outcome.result()));
|
||||
else
|
||||
return ListSourceReplicaOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void IotClient::listSourceReplicaAsync(const ListSourceReplicaRequest& request, const ListSourceReplicaAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, listSourceReplica(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
IotClient::ListSourceReplicaOutcomeCallable IotClient::listSourceReplicaCallable(const ListSourceReplicaRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<ListSourceReplicaOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->listSourceReplica(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
IotClient::ListTaskOutcome IotClient::listTask(const ListTaskRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
@@ -6351,42 +6315,6 @@ IotClient::PushSpeechOutcomeCallable IotClient::pushSpeechCallable(const PushSpe
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
IotClient::QueryAppDeviceListOutcome IotClient::queryAppDeviceList(const QueryAppDeviceListRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return QueryAppDeviceListOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return QueryAppDeviceListOutcome(QueryAppDeviceListResult(outcome.result()));
|
||||
else
|
||||
return QueryAppDeviceListOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void IotClient::queryAppDeviceListAsync(const QueryAppDeviceListRequest& request, const QueryAppDeviceListAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, queryAppDeviceList(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
IotClient::QueryAppDeviceListOutcomeCallable IotClient::queryAppDeviceListCallable(const QueryAppDeviceListRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<QueryAppDeviceListOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->queryAppDeviceList(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
IotClient::QueryBatchRegisterDeviceStatusOutcome IotClient::queryBatchRegisterDeviceStatus(const QueryBatchRegisterDeviceStatusRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
@@ -10131,6 +10059,42 @@ IotClient::SpeechByCombinationOutcomeCallable IotClient::speechByCombinationCall
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
IotClient::SpeechBySynthesisOutcome IotClient::speechBySynthesis(const SpeechBySynthesisRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return SpeechBySynthesisOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return SpeechBySynthesisOutcome(SpeechBySynthesisResult(outcome.result()));
|
||||
else
|
||||
return SpeechBySynthesisOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void IotClient::speechBySynthesisAsync(const SpeechBySynthesisRequest& request, const SpeechBySynthesisAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, speechBySynthesis(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
IotClient::SpeechBySynthesisOutcomeCallable IotClient::speechBySynthesisCallable(const SpeechBySynthesisRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<SpeechBySynthesisOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->speechBySynthesis(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
IotClient::StartRuleOutcome IotClient::startRule(const StartRuleRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
|
||||
@@ -38,6 +38,17 @@ void CreateOTADynamicUpgradeJobRequest::setDynamicMode(int dynamicMode)
|
||||
setParameter("DynamicMode", std::to_string(dynamicMode));
|
||||
}
|
||||
|
||||
bool CreateOTADynamicUpgradeJobRequest::getMultiModuleMode()const
|
||||
{
|
||||
return multiModuleMode_;
|
||||
}
|
||||
|
||||
void CreateOTADynamicUpgradeJobRequest::setMultiModuleMode(bool multiModuleMode)
|
||||
{
|
||||
multiModuleMode_ = multiModuleMode;
|
||||
setParameter("MultiModuleMode", multiModuleMode ? "true" : "false");
|
||||
}
|
||||
|
||||
int CreateOTADynamicUpgradeJobRequest::getRetryCount()const
|
||||
{
|
||||
return retryCount_;
|
||||
|
||||
@@ -27,6 +27,17 @@ CreateOTAStaticUpgradeJobRequest::CreateOTAStaticUpgradeJobRequest() :
|
||||
CreateOTAStaticUpgradeJobRequest::~CreateOTAStaticUpgradeJobRequest()
|
||||
{}
|
||||
|
||||
bool CreateOTAStaticUpgradeJobRequest::getMultiModuleMode()const
|
||||
{
|
||||
return multiModuleMode_;
|
||||
}
|
||||
|
||||
void CreateOTAStaticUpgradeJobRequest::setMultiModuleMode(bool multiModuleMode)
|
||||
{
|
||||
multiModuleMode_ = multiModuleMode;
|
||||
setParameter("MultiModuleMode", multiModuleMode ? "true" : "false");
|
||||
}
|
||||
|
||||
int CreateOTAStaticUpgradeJobRequest::getRetryCount()const
|
||||
{
|
||||
return retryCount_;
|
||||
|
||||
@@ -82,6 +82,17 @@ void CreateSpeechRequest::setText(const std::string& text)
|
||||
setBodyParameter("Text", text);
|
||||
}
|
||||
|
||||
std::string CreateSpeechRequest::getSoundCodeConfig()const
|
||||
{
|
||||
return soundCodeConfig_;
|
||||
}
|
||||
|
||||
void CreateSpeechRequest::setSoundCodeConfig(const std::string& soundCodeConfig)
|
||||
{
|
||||
soundCodeConfig_ = soundCodeConfig;
|
||||
setBodyParameter("SoundCodeConfig", soundCodeConfig);
|
||||
}
|
||||
|
||||
std::string CreateSpeechRequest::getSpeechType()const
|
||||
{
|
||||
return speechType_;
|
||||
@@ -93,6 +104,17 @@ void CreateSpeechRequest::setSpeechType(const std::string& speechType)
|
||||
setBodyParameter("SpeechType", speechType);
|
||||
}
|
||||
|
||||
bool CreateSpeechRequest::getEnableSoundCode()const
|
||||
{
|
||||
return enableSoundCode_;
|
||||
}
|
||||
|
||||
void CreateSpeechRequest::setEnableSoundCode(bool enableSoundCode)
|
||||
{
|
||||
enableSoundCode_ = enableSoundCode;
|
||||
setBodyParameter("EnableSoundCode", enableSoundCode ? "true" : "false");
|
||||
}
|
||||
|
||||
int CreateSpeechRequest::getVolume()const
|
||||
{
|
||||
return volume_;
|
||||
|
||||
@@ -1,117 +0,0 @@
|
||||
/*
|
||||
* 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/ListSourceReplicaRequest.h>
|
||||
|
||||
using AlibabaCloud::Iot::Model::ListSourceReplicaRequest;
|
||||
|
||||
ListSourceReplicaRequest::ListSourceReplicaRequest() :
|
||||
RpcServiceRequest("iot", "2018-01-20", "ListSourceReplica")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
ListSourceReplicaRequest::~ListSourceReplicaRequest()
|
||||
{}
|
||||
|
||||
std::string ListSourceReplicaRequest::getIotInstanceId()const
|
||||
{
|
||||
return iotInstanceId_;
|
||||
}
|
||||
|
||||
void ListSourceReplicaRequest::setIotInstanceId(const std::string& iotInstanceId)
|
||||
{
|
||||
iotInstanceId_ = iotInstanceId;
|
||||
setBodyParameter("IotInstanceId", iotInstanceId);
|
||||
}
|
||||
|
||||
std::string ListSourceReplicaRequest::getContext()const
|
||||
{
|
||||
return context_;
|
||||
}
|
||||
|
||||
void ListSourceReplicaRequest::setContext(const std::string& context)
|
||||
{
|
||||
context_ = context;
|
||||
setBodyParameter("Context", context);
|
||||
}
|
||||
|
||||
int ListSourceReplicaRequest::getPageSize()const
|
||||
{
|
||||
return pageSize_;
|
||||
}
|
||||
|
||||
void ListSourceReplicaRequest::setPageSize(int pageSize)
|
||||
{
|
||||
pageSize_ = pageSize;
|
||||
setParameter("PageSize", std::to_string(pageSize));
|
||||
}
|
||||
|
||||
std::string ListSourceReplicaRequest::getSourceType()const
|
||||
{
|
||||
return sourceType_;
|
||||
}
|
||||
|
||||
void ListSourceReplicaRequest::setSourceType(const std::string& sourceType)
|
||||
{
|
||||
sourceType_ = sourceType;
|
||||
setParameter("SourceType", sourceType);
|
||||
}
|
||||
|
||||
int ListSourceReplicaRequest::getPageNo()const
|
||||
{
|
||||
return pageNo_;
|
||||
}
|
||||
|
||||
void ListSourceReplicaRequest::setPageNo(int pageNo)
|
||||
{
|
||||
pageNo_ = pageNo;
|
||||
setParameter("PageNo", std::to_string(pageNo));
|
||||
}
|
||||
|
||||
std::string ListSourceReplicaRequest::getLpInstanceId()const
|
||||
{
|
||||
return lpInstanceId_;
|
||||
}
|
||||
|
||||
void ListSourceReplicaRequest::setLpInstanceId(const std::string& lpInstanceId)
|
||||
{
|
||||
lpInstanceId_ = lpInstanceId;
|
||||
setParameter("LpInstanceId", lpInstanceId);
|
||||
}
|
||||
|
||||
std::string ListSourceReplicaRequest::getApiProduct()const
|
||||
{
|
||||
return apiProduct_;
|
||||
}
|
||||
|
||||
void ListSourceReplicaRequest::setApiProduct(const std::string& apiProduct)
|
||||
{
|
||||
apiProduct_ = apiProduct;
|
||||
setBodyParameter("ApiProduct", apiProduct);
|
||||
}
|
||||
|
||||
std::string ListSourceReplicaRequest::getApiRevision()const
|
||||
{
|
||||
return apiRevision_;
|
||||
}
|
||||
|
||||
void ListSourceReplicaRequest::setApiRevision(const std::string& apiRevision)
|
||||
{
|
||||
apiRevision_ = apiRevision;
|
||||
setBodyParameter("ApiRevision", apiRevision);
|
||||
}
|
||||
|
||||
@@ -1,125 +0,0 @@
|
||||
/*
|
||||
* 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/ListSourceReplicaResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Iot;
|
||||
using namespace AlibabaCloud::Iot::Model;
|
||||
|
||||
ListSourceReplicaResult::ListSourceReplicaResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
ListSourceReplicaResult::ListSourceReplicaResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
ListSourceReplicaResult::~ListSourceReplicaResult()
|
||||
{}
|
||||
|
||||
void ListSourceReplicaResult::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["Total"].isNull())
|
||||
data_.total = std::stol(dataNode["Total"].asString());
|
||||
if(!dataNode["TotalPage"].isNull())
|
||||
data_.totalPage = std::stol(dataNode["TotalPage"].asString());
|
||||
if(!dataNode["PageSize"].isNull())
|
||||
data_.pageSize = std::stoi(dataNode["PageSize"].asString());
|
||||
if(!dataNode["PageNo"].isNull())
|
||||
data_.pageNo = std::stoi(dataNode["PageNo"].asString());
|
||||
auto allDataListNode = dataNode["DataList"]["DataListItem"];
|
||||
for (auto dataNodeDataListDataListItem : allDataListNode)
|
||||
{
|
||||
Data::DataListItem dataListItemObject;
|
||||
if(!dataNodeDataListDataListItem["ReplicaUid"].isNull())
|
||||
dataListItemObject.replicaUid = dataNodeDataListDataListItem["ReplicaUid"].asString();
|
||||
if(!dataNodeDataListDataListItem["Name"].isNull())
|
||||
dataListItemObject.name = dataNodeDataListDataListItem["Name"].asString();
|
||||
if(!dataNodeDataListDataListItem["Code"].isNull())
|
||||
dataListItemObject.code = dataNodeDataListDataListItem["Code"].asString();
|
||||
if(!dataNodeDataListDataListItem["SourceUid"].isNull())
|
||||
dataListItemObject.sourceUid = dataNodeDataListDataListItem["SourceUid"].asString();
|
||||
if(!dataNodeDataListDataListItem["TableUid"].isNull())
|
||||
dataListItemObject.tableUid = dataNodeDataListDataListItem["TableUid"].asString();
|
||||
if(!dataNodeDataListDataListItem["SourceType"].isNull())
|
||||
dataListItemObject.sourceType = dataNodeDataListDataListItem["SourceType"].asString();
|
||||
if(!dataNodeDataListDataListItem["TimeCycle"].isNull())
|
||||
dataListItemObject.timeCycle = std::stoi(dataNodeDataListDataListItem["TimeCycle"].asString());
|
||||
if(!dataNodeDataListDataListItem["TimeUnit"].isNull())
|
||||
dataListItemObject.timeUnit = dataNodeDataListDataListItem["TimeUnit"].asString();
|
||||
if(!dataNodeDataListDataListItem["Region"].isNull())
|
||||
dataListItemObject.region = std::stoi(dataNodeDataListDataListItem["Region"].asString());
|
||||
if(!dataNodeDataListDataListItem["BeginLatest"].isNull())
|
||||
dataListItemObject.beginLatest = std::stol(dataNodeDataListDataListItem["BeginLatest"].asString());
|
||||
if(!dataNodeDataListDataListItem["EndLatest"].isNull())
|
||||
dataListItemObject.endLatest = std::stol(dataNodeDataListDataListItem["EndLatest"].asString());
|
||||
if(!dataNodeDataListDataListItem["ExtraProperty"].isNull())
|
||||
dataListItemObject.extraProperty = dataNodeDataListDataListItem["ExtraProperty"].asString();
|
||||
if(!dataNodeDataListDataListItem["Status"].isNull())
|
||||
dataListItemObject.status = std::stoi(dataNodeDataListDataListItem["Status"].asString());
|
||||
if(!dataNodeDataListDataListItem["StorageSize"].isNull())
|
||||
dataListItemObject.storageSize = std::stol(dataNodeDataListDataListItem["StorageSize"].asString());
|
||||
if(!dataNodeDataListDataListItem["ProductCreateTime"].isNull())
|
||||
dataListItemObject.productCreateTime = std::stol(dataNodeDataListDataListItem["ProductCreateTime"].asString());
|
||||
if(!dataNodeDataListDataListItem["NodeType"].isNull())
|
||||
dataListItemObject.nodeType = std::stoi(dataNodeDataListDataListItem["NodeType"].asString());
|
||||
if(!dataNodeDataListDataListItem["NeedTips"].isNull())
|
||||
dataListItemObject.needTips = dataNodeDataListDataListItem["NeedTips"].asString() == "true";
|
||||
if(!dataNodeDataListDataListItem["LongJobUid"].isNull())
|
||||
dataListItemObject.longJobUid = dataNodeDataListDataListItem["LongJobUid"].asString();
|
||||
if(!dataNodeDataListDataListItem["Desc"].isNull())
|
||||
dataListItemObject.desc = dataNodeDataListDataListItem["Desc"].asString();
|
||||
if(!dataNodeDataListDataListItem["GmtCreate"].isNull())
|
||||
dataListItemObject.gmtCreate = std::stol(dataNodeDataListDataListItem["GmtCreate"].asString());
|
||||
data_.dataList.push_back(dataListItemObject);
|
||||
}
|
||||
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();
|
||||
|
||||
}
|
||||
|
||||
ListSourceReplicaResult::Data ListSourceReplicaResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
std::string ListSourceReplicaResult::getErrorMessage()const
|
||||
{
|
||||
return errorMessage_;
|
||||
}
|
||||
|
||||
std::string ListSourceReplicaResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
bool ListSourceReplicaResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
@@ -27,17 +27,6 @@ PrintByTemplateRequest::PrintByTemplateRequest() :
|
||||
PrintByTemplateRequest::~PrintByTemplateRequest()
|
||||
{}
|
||||
|
||||
std::string PrintByTemplateRequest::getProjectCode()const
|
||||
{
|
||||
return projectCode_;
|
||||
}
|
||||
|
||||
void PrintByTemplateRequest::setProjectCode(const std::string& projectCode)
|
||||
{
|
||||
projectCode_ = projectCode;
|
||||
setBodyParameter("ProjectCode", projectCode);
|
||||
}
|
||||
|
||||
std::string PrintByTemplateRequest::getTemplateBizCode()const
|
||||
{
|
||||
return templateBizCode_;
|
||||
@@ -71,6 +60,17 @@ void PrintByTemplateRequest::setIotInstanceId(const std::string& iotInstanceId)
|
||||
setBodyParameter("IotInstanceId", iotInstanceId);
|
||||
}
|
||||
|
||||
bool PrintByTemplateRequest::getHistoryPrintTopic()const
|
||||
{
|
||||
return historyPrintTopic_;
|
||||
}
|
||||
|
||||
void PrintByTemplateRequest::setHistoryPrintTopic(bool historyPrintTopic)
|
||||
{
|
||||
historyPrintTopic_ = historyPrintTopic;
|
||||
setBodyParameter("HistoryPrintTopic", historyPrintTopic ? "true" : "false");
|
||||
}
|
||||
|
||||
std::string PrintByTemplateRequest::getProductKey()const
|
||||
{
|
||||
return productKey_;
|
||||
|
||||
@@ -1,137 +0,0 @@
|
||||
/*
|
||||
* 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/QueryAppDeviceListRequest.h>
|
||||
|
||||
using AlibabaCloud::Iot::Model::QueryAppDeviceListRequest;
|
||||
|
||||
QueryAppDeviceListRequest::QueryAppDeviceListRequest() :
|
||||
RpcServiceRequest("iot", "2018-01-20", "QueryAppDeviceList")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
QueryAppDeviceListRequest::~QueryAppDeviceListRequest()
|
||||
{}
|
||||
|
||||
std::vector<QueryAppDeviceListRequest::TagList> QueryAppDeviceListRequest::getTagList()const
|
||||
{
|
||||
return tagList_;
|
||||
}
|
||||
|
||||
void QueryAppDeviceListRequest::setTagList(const std::vector<TagList>& tagList)
|
||||
{
|
||||
tagList_ = tagList;
|
||||
for(int dep1 = 0; dep1!= tagList.size(); dep1++) {
|
||||
auto tagListObj = tagList.at(dep1);
|
||||
std::string tagListObjStr = "TagList." + std::to_string(dep1 + 1);
|
||||
setParameter(tagListObjStr + ".TagName", tagListObj.tagName);
|
||||
setParameter(tagListObjStr + ".TagValue", tagListObj.tagValue);
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<std::string> QueryAppDeviceListRequest::getProductKeyList()const
|
||||
{
|
||||
return productKeyList_;
|
||||
}
|
||||
|
||||
void QueryAppDeviceListRequest::setProductKeyList(const std::vector<std::string>& productKeyList)
|
||||
{
|
||||
productKeyList_ = productKeyList;
|
||||
for(int dep1 = 0; dep1!= productKeyList.size(); dep1++) {
|
||||
setParameter("ProductKeyList."+ std::to_string(dep1), productKeyList.at(dep1));
|
||||
}
|
||||
}
|
||||
|
||||
std::string QueryAppDeviceListRequest::getIotInstanceId()const
|
||||
{
|
||||
return iotInstanceId_;
|
||||
}
|
||||
|
||||
void QueryAppDeviceListRequest::setIotInstanceId(const std::string& iotInstanceId)
|
||||
{
|
||||
iotInstanceId_ = iotInstanceId;
|
||||
setParameter("IotInstanceId", iotInstanceId);
|
||||
}
|
||||
|
||||
int QueryAppDeviceListRequest::getPageSize()const
|
||||
{
|
||||
return pageSize_;
|
||||
}
|
||||
|
||||
void QueryAppDeviceListRequest::setPageSize(int pageSize)
|
||||
{
|
||||
pageSize_ = pageSize;
|
||||
setParameter("PageSize", std::to_string(pageSize));
|
||||
}
|
||||
|
||||
int QueryAppDeviceListRequest::getCurrentPage()const
|
||||
{
|
||||
return currentPage_;
|
||||
}
|
||||
|
||||
void QueryAppDeviceListRequest::setCurrentPage(int currentPage)
|
||||
{
|
||||
currentPage_ = currentPage;
|
||||
setParameter("CurrentPage", std::to_string(currentPage));
|
||||
}
|
||||
|
||||
std::vector<std::string> QueryAppDeviceListRequest::getCategoryKeyList()const
|
||||
{
|
||||
return categoryKeyList_;
|
||||
}
|
||||
|
||||
void QueryAppDeviceListRequest::setCategoryKeyList(const std::vector<std::string>& categoryKeyList)
|
||||
{
|
||||
categoryKeyList_ = categoryKeyList;
|
||||
for(int dep1 = 0; dep1!= categoryKeyList.size(); dep1++) {
|
||||
setParameter("CategoryKeyList."+ std::to_string(dep1), categoryKeyList.at(dep1));
|
||||
}
|
||||
}
|
||||
|
||||
std::string QueryAppDeviceListRequest::getApiProduct()const
|
||||
{
|
||||
return apiProduct_;
|
||||
}
|
||||
|
||||
void QueryAppDeviceListRequest::setApiProduct(const std::string& apiProduct)
|
||||
{
|
||||
apiProduct_ = apiProduct;
|
||||
setBodyParameter("ApiProduct", apiProduct);
|
||||
}
|
||||
|
||||
std::string QueryAppDeviceListRequest::getApiRevision()const
|
||||
{
|
||||
return apiRevision_;
|
||||
}
|
||||
|
||||
void QueryAppDeviceListRequest::setApiRevision(const std::string& apiRevision)
|
||||
{
|
||||
apiRevision_ = apiRevision;
|
||||
setBodyParameter("ApiRevision", apiRevision);
|
||||
}
|
||||
|
||||
std::string QueryAppDeviceListRequest::getAppKey()const
|
||||
{
|
||||
return appKey_;
|
||||
}
|
||||
|
||||
void QueryAppDeviceListRequest::setAppKey(const std::string& appKey)
|
||||
{
|
||||
appKey_ = appKey;
|
||||
setParameter("AppKey", appKey);
|
||||
}
|
||||
|
||||
@@ -1,128 +0,0 @@
|
||||
/*
|
||||
* 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/QueryAppDeviceListResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Iot;
|
||||
using namespace AlibabaCloud::Iot::Model;
|
||||
|
||||
QueryAppDeviceListResult::QueryAppDeviceListResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
QueryAppDeviceListResult::QueryAppDeviceListResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
QueryAppDeviceListResult::~QueryAppDeviceListResult()
|
||||
{}
|
||||
|
||||
void QueryAppDeviceListResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto allDataNode = value["Data"]["DataItem"];
|
||||
for (auto valueDataDataItem : allDataNode)
|
||||
{
|
||||
DataItem dataObject;
|
||||
if(!valueDataDataItem["ProductName"].isNull())
|
||||
dataObject.productName = valueDataDataItem["ProductName"].asString();
|
||||
if(!valueDataDataItem["ProductKey"].isNull())
|
||||
dataObject.productKey = valueDataDataItem["ProductKey"].asString();
|
||||
if(!valueDataDataItem["DeviceName"].isNull())
|
||||
dataObject.deviceName = valueDataDataItem["DeviceName"].asString();
|
||||
if(!valueDataDataItem["NodeType"].isNull())
|
||||
dataObject.nodeType = std::stoi(valueDataDataItem["NodeType"].asString());
|
||||
if(!valueDataDataItem["Status"].isNull())
|
||||
dataObject.status = valueDataDataItem["Status"].asString();
|
||||
if(!valueDataDataItem["ActiveTime"].isNull())
|
||||
dataObject.activeTime = valueDataDataItem["ActiveTime"].asString();
|
||||
if(!valueDataDataItem["LastOnlineTime"].isNull())
|
||||
dataObject.lastOnlineTime = valueDataDataItem["LastOnlineTime"].asString();
|
||||
if(!valueDataDataItem["CreateTime"].isNull())
|
||||
dataObject.createTime = valueDataDataItem["CreateTime"].asString();
|
||||
if(!valueDataDataItem["ChildDeviceCount"].isNull())
|
||||
dataObject.childDeviceCount = std::stol(valueDataDataItem["ChildDeviceCount"].asString());
|
||||
if(!valueDataDataItem["UtcActiveTime"].isNull())
|
||||
dataObject.utcActiveTime = valueDataDataItem["UtcActiveTime"].asString();
|
||||
if(!valueDataDataItem["UtcLastOnlineTime"].isNull())
|
||||
dataObject.utcLastOnlineTime = valueDataDataItem["UtcLastOnlineTime"].asString();
|
||||
if(!valueDataDataItem["UtcCreateTime"].isNull())
|
||||
dataObject.utcCreateTime = valueDataDataItem["UtcCreateTime"].asString();
|
||||
data_.push_back(dataObject);
|
||||
}
|
||||
if(!value["Success"].isNull())
|
||||
success_ = value["Success"].asString() == "true";
|
||||
if(!value["ErrorMessage"].isNull())
|
||||
errorMessage_ = value["ErrorMessage"].asString();
|
||||
if(!value["Code"].isNull())
|
||||
code_ = value["Code"].asString();
|
||||
if(!value["Page"].isNull())
|
||||
page_ = std::stoi(value["Page"].asString());
|
||||
if(!value["PageSize"].isNull())
|
||||
pageSize_ = std::stoi(value["PageSize"].asString());
|
||||
if(!value["PageCount"].isNull())
|
||||
pageCount_ = std::stoi(value["PageCount"].asString());
|
||||
if(!value["Total"].isNull())
|
||||
total_ = std::stoi(value["Total"].asString());
|
||||
|
||||
}
|
||||
|
||||
int QueryAppDeviceListResult::getPageSize()const
|
||||
{
|
||||
return pageSize_;
|
||||
}
|
||||
|
||||
int QueryAppDeviceListResult::getPageCount()const
|
||||
{
|
||||
return pageCount_;
|
||||
}
|
||||
|
||||
int QueryAppDeviceListResult::getTotal()const
|
||||
{
|
||||
return total_;
|
||||
}
|
||||
|
||||
std::vector<QueryAppDeviceListResult::DataItem> QueryAppDeviceListResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
int QueryAppDeviceListResult::getPage()const
|
||||
{
|
||||
return page_;
|
||||
}
|
||||
|
||||
std::string QueryAppDeviceListResult::getErrorMessage()const
|
||||
{
|
||||
return errorMessage_;
|
||||
}
|
||||
|
||||
std::string QueryAppDeviceListResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
bool QueryAppDeviceListResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
@@ -96,6 +96,8 @@ void QueryOTAJobResult::parse(const std::string &payload)
|
||||
data_.groupName = dataNode["GroupName"].asString();
|
||||
if(!dataNode["DownloadProtocol"].isNull())
|
||||
data_.downloadProtocol = dataNode["DownloadProtocol"].asString();
|
||||
if(!dataNode["MultiModuleMode"].isNull())
|
||||
data_.multiModuleMode = dataNode["MultiModuleMode"].asString() == "true";
|
||||
auto allTagsNode = dataNode["Tags"]["OtaTagDTO"];
|
||||
for (auto dataNodeTagsOtaTagDTO : allTagsNode)
|
||||
{
|
||||
|
||||
@@ -56,6 +56,13 @@ void QuerySpeechResult::parse(const std::string &payload)
|
||||
data_.audioFormat = dataNode["AudioFormat"].asString();
|
||||
if(!dataNode["SpeechType"].isNull())
|
||||
data_.speechType = dataNode["SpeechType"].asString();
|
||||
if(!dataNode["EnableSoundCode"].isNull())
|
||||
data_.enableSoundCode = dataNode["EnableSoundCode"].asString() == "true";
|
||||
auto soundCodeConfigNode = dataNode["SoundCodeConfig"];
|
||||
if(!soundCodeConfigNode["AdditionalDuration"].isNull())
|
||||
data_.soundCodeConfig.additionalDuration = std::stoi(soundCodeConfigNode["AdditionalDuration"].asString());
|
||||
if(!soundCodeConfigNode["SoundCodeContent"].isNull())
|
||||
data_.soundCodeConfig.soundCodeContent = soundCodeConfigNode["SoundCodeContent"].asString();
|
||||
if(!value["Success"].isNull())
|
||||
success_ = value["Success"].asString() == "true";
|
||||
if(!value["Code"].isNull())
|
||||
|
||||
161
iot/src/model/SpeechBySynthesisRequest.cc
Normal file
161
iot/src/model/SpeechBySynthesisRequest.cc
Normal file
@@ -0,0 +1,161 @@
|
||||
/*
|
||||
* 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/SpeechBySynthesisRequest.h>
|
||||
|
||||
using AlibabaCloud::Iot::Model::SpeechBySynthesisRequest;
|
||||
|
||||
SpeechBySynthesisRequest::SpeechBySynthesisRequest() :
|
||||
RpcServiceRequest("iot", "2018-01-20", "SpeechBySynthesis")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
SpeechBySynthesisRequest::~SpeechBySynthesisRequest()
|
||||
{}
|
||||
|
||||
std::string SpeechBySynthesisRequest::getVoice()const
|
||||
{
|
||||
return voice_;
|
||||
}
|
||||
|
||||
void SpeechBySynthesisRequest::setVoice(const std::string& voice)
|
||||
{
|
||||
voice_ = voice;
|
||||
setBodyParameter("Voice", voice);
|
||||
}
|
||||
|
||||
std::string SpeechBySynthesisRequest::getSpeechId()const
|
||||
{
|
||||
return speechId_;
|
||||
}
|
||||
|
||||
void SpeechBySynthesisRequest::setSpeechId(const std::string& speechId)
|
||||
{
|
||||
speechId_ = speechId;
|
||||
setBodyParameter("SpeechId", speechId);
|
||||
}
|
||||
|
||||
std::string SpeechBySynthesisRequest::getAudioFormat()const
|
||||
{
|
||||
return audioFormat_;
|
||||
}
|
||||
|
||||
void SpeechBySynthesisRequest::setAudioFormat(const std::string& audioFormat)
|
||||
{
|
||||
audioFormat_ = audioFormat;
|
||||
setBodyParameter("AudioFormat", audioFormat);
|
||||
}
|
||||
|
||||
std::string SpeechBySynthesisRequest::getIotId()const
|
||||
{
|
||||
return iotId_;
|
||||
}
|
||||
|
||||
void SpeechBySynthesisRequest::setIotId(const std::string& iotId)
|
||||
{
|
||||
iotId_ = iotId;
|
||||
setBodyParameter("IotId", iotId);
|
||||
}
|
||||
|
||||
std::string SpeechBySynthesisRequest::getIotInstanceId()const
|
||||
{
|
||||
return iotInstanceId_;
|
||||
}
|
||||
|
||||
void SpeechBySynthesisRequest::setIotInstanceId(const std::string& iotInstanceId)
|
||||
{
|
||||
iotInstanceId_ = iotInstanceId;
|
||||
setBodyParameter("IotInstanceId", iotInstanceId);
|
||||
}
|
||||
|
||||
std::string SpeechBySynthesisRequest::getText()const
|
||||
{
|
||||
return text_;
|
||||
}
|
||||
|
||||
void SpeechBySynthesisRequest::setText(const std::string& text)
|
||||
{
|
||||
text_ = text;
|
||||
setBodyParameter("Text", text);
|
||||
}
|
||||
|
||||
std::string SpeechBySynthesisRequest::getProductKey()const
|
||||
{
|
||||
return productKey_;
|
||||
}
|
||||
|
||||
void SpeechBySynthesisRequest::setProductKey(const std::string& productKey)
|
||||
{
|
||||
productKey_ = productKey;
|
||||
setBodyParameter("ProductKey", productKey);
|
||||
}
|
||||
|
||||
int SpeechBySynthesisRequest::getVolume()const
|
||||
{
|
||||
return volume_;
|
||||
}
|
||||
|
||||
void SpeechBySynthesisRequest::setVolume(int volume)
|
||||
{
|
||||
volume_ = volume;
|
||||
setBodyParameter("Volume", std::to_string(volume));
|
||||
}
|
||||
|
||||
std::string SpeechBySynthesisRequest::getApiProduct()const
|
||||
{
|
||||
return apiProduct_;
|
||||
}
|
||||
|
||||
void SpeechBySynthesisRequest::setApiProduct(const std::string& apiProduct)
|
||||
{
|
||||
apiProduct_ = apiProduct;
|
||||
setBodyParameter("ApiProduct", apiProduct);
|
||||
}
|
||||
|
||||
std::string SpeechBySynthesisRequest::getApiRevision()const
|
||||
{
|
||||
return apiRevision_;
|
||||
}
|
||||
|
||||
void SpeechBySynthesisRequest::setApiRevision(const std::string& apiRevision)
|
||||
{
|
||||
apiRevision_ = apiRevision;
|
||||
setBodyParameter("ApiRevision", apiRevision);
|
||||
}
|
||||
|
||||
std::string SpeechBySynthesisRequest::getDeviceName()const
|
||||
{
|
||||
return deviceName_;
|
||||
}
|
||||
|
||||
void SpeechBySynthesisRequest::setDeviceName(const std::string& deviceName)
|
||||
{
|
||||
deviceName_ = deviceName;
|
||||
setBodyParameter("DeviceName", deviceName);
|
||||
}
|
||||
|
||||
int SpeechBySynthesisRequest::getSpeechRate()const
|
||||
{
|
||||
return speechRate_;
|
||||
}
|
||||
|
||||
void SpeechBySynthesisRequest::setSpeechRate(int speechRate)
|
||||
{
|
||||
speechRate_ = speechRate;
|
||||
setBodyParameter("SpeechRate", std::to_string(speechRate));
|
||||
}
|
||||
|
||||
65
iot/src/model/SpeechBySynthesisResult.cc
Normal file
65
iot/src/model/SpeechBySynthesisResult.cc
Normal 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/iot/model/SpeechBySynthesisResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Iot;
|
||||
using namespace AlibabaCloud::Iot::Model;
|
||||
|
||||
SpeechBySynthesisResult::SpeechBySynthesisResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
SpeechBySynthesisResult::SpeechBySynthesisResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
SpeechBySynthesisResult::~SpeechBySynthesisResult()
|
||||
{}
|
||||
|
||||
void SpeechBySynthesisResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].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();
|
||||
|
||||
}
|
||||
|
||||
std::string SpeechBySynthesisResult::getErrorMessage()const
|
||||
{
|
||||
return errorMessage_;
|
||||
}
|
||||
|
||||
std::string SpeechBySynthesisResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
bool SpeechBySynthesisResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
@@ -82,6 +82,17 @@ void TestSpeechRequest::setText(const std::string& text)
|
||||
setBodyParameter("Text", text);
|
||||
}
|
||||
|
||||
std::string TestSpeechRequest::getSoundCodeConfig()const
|
||||
{
|
||||
return soundCodeConfig_;
|
||||
}
|
||||
|
||||
void TestSpeechRequest::setSoundCodeConfig(const std::string& soundCodeConfig)
|
||||
{
|
||||
soundCodeConfig_ = soundCodeConfig;
|
||||
setBodyParameter("SoundCodeConfig", soundCodeConfig);
|
||||
}
|
||||
|
||||
std::string TestSpeechRequest::getSpeechType()const
|
||||
{
|
||||
return speechType_;
|
||||
@@ -93,6 +104,17 @@ void TestSpeechRequest::setSpeechType(const std::string& speechType)
|
||||
setBodyParameter("SpeechType", speechType);
|
||||
}
|
||||
|
||||
bool TestSpeechRequest::getEnableSoundCode()const
|
||||
{
|
||||
return enableSoundCode_;
|
||||
}
|
||||
|
||||
void TestSpeechRequest::setEnableSoundCode(bool enableSoundCode)
|
||||
{
|
||||
enableSoundCode_ = enableSoundCode;
|
||||
setBodyParameter("EnableSoundCode", enableSoundCode ? "true" : "false");
|
||||
}
|
||||
|
||||
int TestSpeechRequest::getVolume()const
|
||||
{
|
||||
return volume_;
|
||||
|
||||
@@ -60,6 +60,28 @@ void UpdateSpeechRequest::setIotInstanceId(const std::string& iotInstanceId)
|
||||
setBodyParameter("IotInstanceId", iotInstanceId);
|
||||
}
|
||||
|
||||
std::string UpdateSpeechRequest::getSoundCodeConfig()const
|
||||
{
|
||||
return soundCodeConfig_;
|
||||
}
|
||||
|
||||
void UpdateSpeechRequest::setSoundCodeConfig(const std::string& soundCodeConfig)
|
||||
{
|
||||
soundCodeConfig_ = soundCodeConfig;
|
||||
setBodyParameter("SoundCodeConfig", soundCodeConfig);
|
||||
}
|
||||
|
||||
bool UpdateSpeechRequest::getEnableSoundCode()const
|
||||
{
|
||||
return enableSoundCode_;
|
||||
}
|
||||
|
||||
void UpdateSpeechRequest::setEnableSoundCode(bool enableSoundCode)
|
||||
{
|
||||
enableSoundCode_ = enableSoundCode;
|
||||
setBodyParameter("EnableSoundCode", enableSoundCode ? "true" : "false");
|
||||
}
|
||||
|
||||
int UpdateSpeechRequest::getVolume()const
|
||||
{
|
||||
return volume_;
|
||||
|
||||
Reference in New Issue
Block a user