Add DeviceCenter API, including CreateDeviceDynamicGroup, DeleteDeviceDynamicGroup, QueryDynamicGroupDevices.

This commit is contained in:
sdk-team
2021-10-20 13:11:16 +00:00
parent f73358f7e8
commit c132dd86ae
75 changed files with 3757 additions and 1 deletions

View File

@@ -51,6 +51,78 @@ IotClient::IotClient(const std::string & accessKeyId, const std::string & access
IotClient::~IotClient()
{}
IotClient::AddDataForApiSourceOutcome IotClient::addDataForApiSource(const AddDataForApiSourceRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return AddDataForApiSourceOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return AddDataForApiSourceOutcome(AddDataForApiSourceResult(outcome.result()));
else
return AddDataForApiSourceOutcome(outcome.error());
}
void IotClient::addDataForApiSourceAsync(const AddDataForApiSourceRequest& request, const AddDataForApiSourceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, addDataForApiSource(request), context);
};
asyncExecute(new Runnable(fn));
}
IotClient::AddDataForApiSourceOutcomeCallable IotClient::addDataForApiSourceCallable(const AddDataForApiSourceRequest &request) const
{
auto task = std::make_shared<std::packaged_task<AddDataForApiSourceOutcome()>>(
[this, request]()
{
return this->addDataForApiSource(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
IotClient::BatchAddDataForApiSourceOutcome IotClient::batchAddDataForApiSource(const BatchAddDataForApiSourceRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return BatchAddDataForApiSourceOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return BatchAddDataForApiSourceOutcome(BatchAddDataForApiSourceResult(outcome.result()));
else
return BatchAddDataForApiSourceOutcome(outcome.error());
}
void IotClient::batchAddDataForApiSourceAsync(const BatchAddDataForApiSourceRequest& request, const BatchAddDataForApiSourceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, batchAddDataForApiSource(request), context);
};
asyncExecute(new Runnable(fn));
}
IotClient::BatchAddDataForApiSourceOutcomeCallable IotClient::batchAddDataForApiSourceCallable(const BatchAddDataForApiSourceRequest &request) const
{
auto task = std::make_shared<std::packaged_task<BatchAddDataForApiSourceOutcome()>>(
[this, request]()
{
return this->batchAddDataForApiSource(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
IotClient::BatchAddDeviceGroupRelationsOutcome IotClient::batchAddDeviceGroupRelations(const BatchAddDeviceGroupRelationsRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -1419,6 +1491,42 @@ IotClient::ClearEdgeInstanceDriverConfigsOutcomeCallable IotClient::clearEdgeIns
return task->get_future();
}
IotClient::CloseDeviceTunnelOutcome IotClient::closeDeviceTunnel(const CloseDeviceTunnelRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return CloseDeviceTunnelOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return CloseDeviceTunnelOutcome(CloseDeviceTunnelResult(outcome.result()));
else
return CloseDeviceTunnelOutcome(outcome.error());
}
void IotClient::closeDeviceTunnelAsync(const CloseDeviceTunnelRequest& request, const CloseDeviceTunnelAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, closeDeviceTunnel(request), context);
};
asyncExecute(new Runnable(fn));
}
IotClient::CloseDeviceTunnelOutcomeCallable IotClient::closeDeviceTunnelCallable(const CloseDeviceTunnelRequest &request) const
{
auto task = std::make_shared<std::packaged_task<CloseDeviceTunnelOutcome()>>(
[this, request]()
{
return this->closeDeviceTunnel(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
IotClient::CloseEdgeInstanceDeploymentOutcome IotClient::closeEdgeInstanceDeployment(const CloseEdgeInstanceDeploymentRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -1671,6 +1779,42 @@ IotClient::CreateDeviceDistributeJobOutcomeCallable IotClient::createDeviceDistr
return task->get_future();
}
IotClient::CreateDeviceDynamicGroupOutcome IotClient::createDeviceDynamicGroup(const CreateDeviceDynamicGroupRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return CreateDeviceDynamicGroupOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return CreateDeviceDynamicGroupOutcome(CreateDeviceDynamicGroupResult(outcome.result()));
else
return CreateDeviceDynamicGroupOutcome(outcome.error());
}
void IotClient::createDeviceDynamicGroupAsync(const CreateDeviceDynamicGroupRequest& request, const CreateDeviceDynamicGroupAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, createDeviceDynamicGroup(request), context);
};
asyncExecute(new Runnable(fn));
}
IotClient::CreateDeviceDynamicGroupOutcomeCallable IotClient::createDeviceDynamicGroupCallable(const CreateDeviceDynamicGroupRequest &request) const
{
auto task = std::make_shared<std::packaged_task<CreateDeviceDynamicGroupOutcome()>>(
[this, request]()
{
return this->createDeviceDynamicGroup(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
IotClient::CreateDeviceGroupOutcome IotClient::createDeviceGroup(const CreateDeviceGroupRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -1707,6 +1851,42 @@ IotClient::CreateDeviceGroupOutcomeCallable IotClient::createDeviceGroupCallable
return task->get_future();
}
IotClient::CreateDeviceTunnelOutcome IotClient::createDeviceTunnel(const CreateDeviceTunnelRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return CreateDeviceTunnelOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return CreateDeviceTunnelOutcome(CreateDeviceTunnelResult(outcome.result()));
else
return CreateDeviceTunnelOutcome(outcome.error());
}
void IotClient::createDeviceTunnelAsync(const CreateDeviceTunnelRequest& request, const CreateDeviceTunnelAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, createDeviceTunnel(request), context);
};
asyncExecute(new Runnable(fn));
}
IotClient::CreateDeviceTunnelOutcomeCallable IotClient::createDeviceTunnelCallable(const CreateDeviceTunnelRequest &request) const
{
auto task = std::make_shared<std::packaged_task<CreateDeviceTunnelOutcome()>>(
[this, request]()
{
return this->createDeviceTunnel(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
IotClient::CreateEdgeDriverOutcome IotClient::createEdgeDriver(const CreateEdgeDriverRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -2895,6 +3075,42 @@ IotClient::DeleteDeviceDistributeJobOutcomeCallable IotClient::deleteDeviceDistr
return task->get_future();
}
IotClient::DeleteDeviceDynamicGroupOutcome IotClient::deleteDeviceDynamicGroup(const DeleteDeviceDynamicGroupRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return DeleteDeviceDynamicGroupOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return DeleteDeviceDynamicGroupOutcome(DeleteDeviceDynamicGroupResult(outcome.result()));
else
return DeleteDeviceDynamicGroupOutcome(outcome.error());
}
void IotClient::deleteDeviceDynamicGroupAsync(const DeleteDeviceDynamicGroupRequest& request, const DeleteDeviceDynamicGroupAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, deleteDeviceDynamicGroup(request), context);
};
asyncExecute(new Runnable(fn));
}
IotClient::DeleteDeviceDynamicGroupOutcomeCallable IotClient::deleteDeviceDynamicGroupCallable(const DeleteDeviceDynamicGroupRequest &request) const
{
auto task = std::make_shared<std::packaged_task<DeleteDeviceDynamicGroupOutcome()>>(
[this, request]()
{
return this->deleteDeviceDynamicGroup(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
IotClient::DeleteDeviceFileOutcome IotClient::deleteDeviceFile(const DeleteDeviceFileRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -3039,6 +3255,42 @@ IotClient::DeleteDeviceSpeechOutcomeCallable IotClient::deleteDeviceSpeechCallab
return task->get_future();
}
IotClient::DeleteDeviceTunnelOutcome IotClient::deleteDeviceTunnel(const DeleteDeviceTunnelRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return DeleteDeviceTunnelOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return DeleteDeviceTunnelOutcome(DeleteDeviceTunnelResult(outcome.result()));
else
return DeleteDeviceTunnelOutcome(outcome.error());
}
void IotClient::deleteDeviceTunnelAsync(const DeleteDeviceTunnelRequest& request, const DeleteDeviceTunnelAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, deleteDeviceTunnel(request), context);
};
asyncExecute(new Runnable(fn));
}
IotClient::DeleteDeviceTunnelOutcomeCallable IotClient::deleteDeviceTunnelCallable(const DeleteDeviceTunnelRequest &request) const
{
auto task = std::make_shared<std::packaged_task<DeleteDeviceTunnelOutcome()>>(
[this, request]()
{
return this->deleteDeviceTunnel(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
IotClient::DeleteEdgeDriverOutcome IotClient::deleteEdgeDriver(const DeleteEdgeDriverRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -5631,6 +5883,42 @@ 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();
@@ -7431,6 +7719,78 @@ IotClient::QueryDeviceStatisticsOutcomeCallable IotClient::queryDeviceStatistics
return task->get_future();
}
IotClient::QueryDeviceTunnelOutcome IotClient::queryDeviceTunnel(const QueryDeviceTunnelRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return QueryDeviceTunnelOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return QueryDeviceTunnelOutcome(QueryDeviceTunnelResult(outcome.result()));
else
return QueryDeviceTunnelOutcome(outcome.error());
}
void IotClient::queryDeviceTunnelAsync(const QueryDeviceTunnelRequest& request, const QueryDeviceTunnelAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, queryDeviceTunnel(request), context);
};
asyncExecute(new Runnable(fn));
}
IotClient::QueryDeviceTunnelOutcomeCallable IotClient::queryDeviceTunnelCallable(const QueryDeviceTunnelRequest &request) const
{
auto task = std::make_shared<std::packaged_task<QueryDeviceTunnelOutcome()>>(
[this, request]()
{
return this->queryDeviceTunnel(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
IotClient::QueryDynamicGroupDevicesOutcome IotClient::queryDynamicGroupDevices(const QueryDynamicGroupDevicesRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return QueryDynamicGroupDevicesOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return QueryDynamicGroupDevicesOutcome(QueryDynamicGroupDevicesResult(outcome.result()));
else
return QueryDynamicGroupDevicesOutcome(outcome.error());
}
void IotClient::queryDynamicGroupDevicesAsync(const QueryDynamicGroupDevicesRequest& request, const QueryDynamicGroupDevicesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, queryDynamicGroupDevices(request), context);
};
asyncExecute(new Runnable(fn));
}
IotClient::QueryDynamicGroupDevicesOutcomeCallable IotClient::queryDynamicGroupDevicesCallable(const QueryDynamicGroupDevicesRequest &request) const
{
auto task = std::make_shared<std::packaged_task<QueryDynamicGroupDevicesOutcome()>>(
[this, request]()
{
return this->queryDynamicGroupDevices(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
IotClient::QueryEdgeDriverOutcome IotClient::queryEdgeDriver(const QueryEdgeDriverRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();

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/AddDataForApiSourceRequest.h>
using AlibabaCloud::Iot::Model::AddDataForApiSourceRequest;
AddDataForApiSourceRequest::AddDataForApiSourceRequest() :
RpcServiceRequest("iot", "2018-01-20", "AddDataForApiSource")
{
setMethod(HttpRequest::Method::Post);
}
AddDataForApiSourceRequest::~AddDataForApiSourceRequest()
{}
std::string AddDataForApiSourceRequest::getContent()const
{
return content_;
}
void AddDataForApiSourceRequest::setContent(const std::string& content)
{
content_ = content;
setParameter("Content", content);
}
std::string AddDataForApiSourceRequest::getIotInstanceId()const
{
return iotInstanceId_;
}
void AddDataForApiSourceRequest::setIotInstanceId(const std::string& iotInstanceId)
{
iotInstanceId_ = iotInstanceId;
setParameter("IotInstanceId", iotInstanceId);
}
std::string AddDataForApiSourceRequest::getApiProduct()const
{
return apiProduct_;
}
void AddDataForApiSourceRequest::setApiProduct(const std::string& apiProduct)
{
apiProduct_ = apiProduct;
setBodyParameter("ApiProduct", apiProduct);
}
std::string AddDataForApiSourceRequest::getApiRevision()const
{
return apiRevision_;
}
void AddDataForApiSourceRequest::setApiRevision(const std::string& apiRevision)
{
apiRevision_ = apiRevision;
setBodyParameter("ApiRevision", apiRevision);
}
std::string AddDataForApiSourceRequest::getApiId()const
{
return apiId_;
}
void AddDataForApiSourceRequest::setApiId(const std::string& apiId)
{
apiId_ = apiId;
setParameter("ApiId", apiId);
}

View File

@@ -0,0 +1,72 @@
/*
* 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/AddDataForApiSourceResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Iot;
using namespace AlibabaCloud::Iot::Model;
AddDataForApiSourceResult::AddDataForApiSourceResult() :
ServiceResult()
{}
AddDataForApiSourceResult::AddDataForApiSourceResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
AddDataForApiSourceResult::~AddDataForApiSourceResult()
{}
void AddDataForApiSourceResult::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();
if(!value["Data"].isNull())
data_ = std::stol(value["Data"].asString());
}
long AddDataForApiSourceResult::getData()const
{
return data_;
}
std::string AddDataForApiSourceResult::getErrorMessage()const
{
return errorMessage_;
}
std::string AddDataForApiSourceResult::getCode()const
{
return code_;
}
bool AddDataForApiSourceResult::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/BatchAddDataForApiSourceRequest.h>
using AlibabaCloud::Iot::Model::BatchAddDataForApiSourceRequest;
BatchAddDataForApiSourceRequest::BatchAddDataForApiSourceRequest() :
RpcServiceRequest("iot", "2018-01-20", "BatchAddDataForApiSource")
{
setMethod(HttpRequest::Method::Post);
}
BatchAddDataForApiSourceRequest::~BatchAddDataForApiSourceRequest()
{}
std::string BatchAddDataForApiSourceRequest::getContentList()const
{
return contentList_;
}
void BatchAddDataForApiSourceRequest::setContentList(const std::string& contentList)
{
contentList_ = contentList;
setParameter("ContentList", contentList);
}
std::string BatchAddDataForApiSourceRequest::getIotInstanceId()const
{
return iotInstanceId_;
}
void BatchAddDataForApiSourceRequest::setIotInstanceId(const std::string& iotInstanceId)
{
iotInstanceId_ = iotInstanceId;
setParameter("IotInstanceId", iotInstanceId);
}
std::string BatchAddDataForApiSourceRequest::getApiProduct()const
{
return apiProduct_;
}
void BatchAddDataForApiSourceRequest::setApiProduct(const std::string& apiProduct)
{
apiProduct_ = apiProduct;
setBodyParameter("ApiProduct", apiProduct);
}
std::string BatchAddDataForApiSourceRequest::getApiRevision()const
{
return apiRevision_;
}
void BatchAddDataForApiSourceRequest::setApiRevision(const std::string& apiRevision)
{
apiRevision_ = apiRevision;
setBodyParameter("ApiRevision", apiRevision);
}
std::string BatchAddDataForApiSourceRequest::getApiId()const
{
return apiId_;
}
void BatchAddDataForApiSourceRequest::setApiId(const std::string& apiId)
{
apiId_ = apiId;
setParameter("ApiId", apiId);
}

View File

@@ -0,0 +1,72 @@
/*
* 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/BatchAddDataForApiSourceResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Iot;
using namespace AlibabaCloud::Iot::Model;
BatchAddDataForApiSourceResult::BatchAddDataForApiSourceResult() :
ServiceResult()
{}
BatchAddDataForApiSourceResult::BatchAddDataForApiSourceResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
BatchAddDataForApiSourceResult::~BatchAddDataForApiSourceResult()
{}
void BatchAddDataForApiSourceResult::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();
if(!value["Data"].isNull())
data_ = value["Data"].asString();
}
std::string BatchAddDataForApiSourceResult::getData()const
{
return data_;
}
std::string BatchAddDataForApiSourceResult::getErrorMessage()const
{
return errorMessage_;
}
std::string BatchAddDataForApiSourceResult::getCode()const
{
return code_;
}
bool BatchAddDataForApiSourceResult::getSuccess()const
{
return success_;
}

View File

@@ -61,6 +61,8 @@ void BatchGetEdgeDriverResult::parse(const std::string &payload)
driverListObject.gmtCreateTimestamp = std::stol(valueDriverListDriver["GmtCreateTimestamp"].asString());
if(!valueDriverListDriver["GmtModifiedTimestamp"].isNull())
driverListObject.gmtModifiedTimestamp = std::stol(valueDriverListDriver["GmtModifiedTimestamp"].asString());
if(!valueDriverListDriver["UseOfficialConfig"].isNull())
driverListObject.useOfficialConfig = std::stoi(valueDriverListDriver["UseOfficialConfig"].asString());
driverList_.push_back(driverListObject);
}
if(!value["Success"].isNull())

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/iot/model/CloseDeviceTunnelRequest.h>
using AlibabaCloud::Iot::Model::CloseDeviceTunnelRequest;
CloseDeviceTunnelRequest::CloseDeviceTunnelRequest() :
RpcServiceRequest("iot", "2018-01-20", "CloseDeviceTunnel")
{
setMethod(HttpRequest::Method::Post);
}
CloseDeviceTunnelRequest::~CloseDeviceTunnelRequest()
{}
std::string CloseDeviceTunnelRequest::getIotInstanceId()const
{
return iotInstanceId_;
}
void CloseDeviceTunnelRequest::setIotInstanceId(const std::string& iotInstanceId)
{
iotInstanceId_ = iotInstanceId;
setParameter("IotInstanceId", iotInstanceId);
}
std::string CloseDeviceTunnelRequest::getTunnelId()const
{
return tunnelId_;
}
void CloseDeviceTunnelRequest::setTunnelId(const std::string& tunnelId)
{
tunnelId_ = tunnelId;
setParameter("TunnelId", tunnelId);
}
std::string CloseDeviceTunnelRequest::getApiProduct()const
{
return apiProduct_;
}
void CloseDeviceTunnelRequest::setApiProduct(const std::string& apiProduct)
{
apiProduct_ = apiProduct;
setBodyParameter("ApiProduct", apiProduct);
}
std::string CloseDeviceTunnelRequest::getApiRevision()const
{
return apiRevision_;
}
void CloseDeviceTunnelRequest::setApiRevision(const std::string& apiRevision)
{
apiRevision_ = apiRevision;
setBodyParameter("ApiRevision", apiRevision);
}

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/iot/model/CloseDeviceTunnelResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Iot;
using namespace AlibabaCloud::Iot::Model;
CloseDeviceTunnelResult::CloseDeviceTunnelResult() :
ServiceResult()
{}
CloseDeviceTunnelResult::CloseDeviceTunnelResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
CloseDeviceTunnelResult::~CloseDeviceTunnelResult()
{}
void CloseDeviceTunnelResult::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 CloseDeviceTunnelResult::getErrorMessage()const
{
return errorMessage_;
}
std::string CloseDeviceTunnelResult::getCode()const
{
return code_;
}
bool CloseDeviceTunnelResult::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/iot/model/CreateDeviceDynamicGroupRequest.h>
using AlibabaCloud::Iot::Model::CreateDeviceDynamicGroupRequest;
CreateDeviceDynamicGroupRequest::CreateDeviceDynamicGroupRequest() :
RpcServiceRequest("iot", "2018-01-20", "CreateDeviceDynamicGroup")
{
setMethod(HttpRequest::Method::Post);
}
CreateDeviceDynamicGroupRequest::~CreateDeviceDynamicGroupRequest()
{}
std::string CreateDeviceDynamicGroupRequest::getDynamicGroupExpression()const
{
return dynamicGroupExpression_;
}
void CreateDeviceDynamicGroupRequest::setDynamicGroupExpression(const std::string& dynamicGroupExpression)
{
dynamicGroupExpression_ = dynamicGroupExpression;
setParameter("DynamicGroupExpression", dynamicGroupExpression);
}
std::string CreateDeviceDynamicGroupRequest::getIotInstanceId()const
{
return iotInstanceId_;
}
void CreateDeviceDynamicGroupRequest::setIotInstanceId(const std::string& iotInstanceId)
{
iotInstanceId_ = iotInstanceId;
setParameter("IotInstanceId", iotInstanceId);
}
std::string CreateDeviceDynamicGroupRequest::getGroupName()const
{
return groupName_;
}
void CreateDeviceDynamicGroupRequest::setGroupName(const std::string& groupName)
{
groupName_ = groupName;
setParameter("GroupName", groupName);
}
std::string CreateDeviceDynamicGroupRequest::getGroupDesc()const
{
return groupDesc_;
}
void CreateDeviceDynamicGroupRequest::setGroupDesc(const std::string& groupDesc)
{
groupDesc_ = groupDesc;
setParameter("GroupDesc", groupDesc);
}
std::string CreateDeviceDynamicGroupRequest::getApiProduct()const
{
return apiProduct_;
}
void CreateDeviceDynamicGroupRequest::setApiProduct(const std::string& apiProduct)
{
apiProduct_ = apiProduct;
setBodyParameter("ApiProduct", apiProduct);
}
std::string CreateDeviceDynamicGroupRequest::getApiRevision()const
{
return apiRevision_;
}
void CreateDeviceDynamicGroupRequest::setApiRevision(const std::string& apiRevision)
{
apiRevision_ = apiRevision;
setBodyParameter("ApiRevision", apiRevision);
}

View File

@@ -0,0 +1,81 @@
/*
* 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/CreateDeviceDynamicGroupResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Iot;
using namespace AlibabaCloud::Iot::Model;
CreateDeviceDynamicGroupResult::CreateDeviceDynamicGroupResult() :
ServiceResult()
{}
CreateDeviceDynamicGroupResult::CreateDeviceDynamicGroupResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
CreateDeviceDynamicGroupResult::~CreateDeviceDynamicGroupResult()
{}
void CreateDeviceDynamicGroupResult::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["GroupId"].isNull())
data_.groupId = dataNode["GroupId"].asString();
if(!dataNode["UtcCreate"].isNull())
data_.utcCreate = dataNode["UtcCreate"].asString();
if(!dataNode["GroupName"].isNull())
data_.groupName = dataNode["GroupName"].asString();
if(!dataNode["GroupDesc"].isNull())
data_.groupDesc = dataNode["GroupDesc"].asString();
if(!dataNode["DynamicGroupExpression"].isNull())
data_.dynamicGroupExpression = dataNode["DynamicGroupExpression"].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();
}
CreateDeviceDynamicGroupResult::Data CreateDeviceDynamicGroupResult::getData()const
{
return data_;
}
std::string CreateDeviceDynamicGroupResult::getErrorMessage()const
{
return errorMessage_;
}
std::string CreateDeviceDynamicGroupResult::getCode()const
{
return code_;
}
bool CreateDeviceDynamicGroupResult::getSuccess()const
{
return success_;
}

View File

@@ -0,0 +1,117 @@
/*
* 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/CreateDeviceTunnelRequest.h>
using AlibabaCloud::Iot::Model::CreateDeviceTunnelRequest;
CreateDeviceTunnelRequest::CreateDeviceTunnelRequest() :
RpcServiceRequest("iot", "2018-01-20", "CreateDeviceTunnel")
{
setMethod(HttpRequest::Method::Post);
}
CreateDeviceTunnelRequest::~CreateDeviceTunnelRequest()
{}
std::string CreateDeviceTunnelRequest::getDescription()const
{
return description_;
}
void CreateDeviceTunnelRequest::setDescription(const std::string& description)
{
description_ = description;
setParameter("Description", description);
}
std::string CreateDeviceTunnelRequest::getIotId()const
{
return iotId_;
}
void CreateDeviceTunnelRequest::setIotId(const std::string& iotId)
{
iotId_ = iotId;
setParameter("IotId", iotId);
}
std::string CreateDeviceTunnelRequest::getIotInstanceId()const
{
return iotInstanceId_;
}
void CreateDeviceTunnelRequest::setIotInstanceId(const std::string& iotInstanceId)
{
iotInstanceId_ = iotInstanceId;
setParameter("IotInstanceId", iotInstanceId);
}
std::string CreateDeviceTunnelRequest::getProductKey()const
{
return productKey_;
}
void CreateDeviceTunnelRequest::setProductKey(const std::string& productKey)
{
productKey_ = productKey;
setParameter("ProductKey", productKey);
}
std::string CreateDeviceTunnelRequest::getApiProduct()const
{
return apiProduct_;
}
void CreateDeviceTunnelRequest::setApiProduct(const std::string& apiProduct)
{
apiProduct_ = apiProduct;
setBodyParameter("ApiProduct", apiProduct);
}
std::string CreateDeviceTunnelRequest::getApiRevision()const
{
return apiRevision_;
}
void CreateDeviceTunnelRequest::setApiRevision(const std::string& apiRevision)
{
apiRevision_ = apiRevision;
setBodyParameter("ApiRevision", apiRevision);
}
std::string CreateDeviceTunnelRequest::getDeviceName()const
{
return deviceName_;
}
void CreateDeviceTunnelRequest::setDeviceName(const std::string& deviceName)
{
deviceName_ = deviceName;
setParameter("DeviceName", deviceName);
}
std::string CreateDeviceTunnelRequest::getUdi()const
{
return udi_;
}
void CreateDeviceTunnelRequest::setUdi(const std::string& udi)
{
udi_ = udi;
setParameter("Udi", udi);
}

View File

@@ -0,0 +1,77 @@
/*
* 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/CreateDeviceTunnelResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Iot;
using namespace AlibabaCloud::Iot::Model;
CreateDeviceTunnelResult::CreateDeviceTunnelResult() :
ServiceResult()
{}
CreateDeviceTunnelResult::CreateDeviceTunnelResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
CreateDeviceTunnelResult::~CreateDeviceTunnelResult()
{}
void CreateDeviceTunnelResult::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["TunnelId"].isNull())
data_.tunnelId = dataNode["TunnelId"].asString();
if(!dataNode["SourceAccessToken"].isNull())
data_.sourceAccessToken = dataNode["SourceAccessToken"].asString();
if(!dataNode["SourceURI"].isNull())
data_.sourceURI = dataNode["SourceURI"].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();
}
CreateDeviceTunnelResult::Data CreateDeviceTunnelResult::getData()const
{
return data_;
}
std::string CreateDeviceTunnelResult::getErrorMessage()const
{
return errorMessage_;
}
std::string CreateDeviceTunnelResult::getCode()const
{
return code_;
}
bool CreateDeviceTunnelResult::getSuccess()const
{
return success_;
}

View File

@@ -93,6 +93,17 @@ void CreateEdgeDriverRequest::setRuntime(const std::string& runtime)
setParameter("Runtime", runtime);
}
int CreateEdgeDriverRequest::getUseOfficialConfig()const
{
return useOfficialConfig_;
}
void CreateEdgeDriverRequest::setUseOfficialConfig(int useOfficialConfig)
{
useOfficialConfig_ = useOfficialConfig;
setParameter("UseOfficialConfig", std::to_string(useOfficialConfig));
}
std::string CreateEdgeDriverRequest::getApiProduct()const
{
return apiProduct_;

View File

@@ -82,6 +82,17 @@ void CreateOTADynamicUpgradeJobRequest::setAccessKeyId(const std::string& access
setParameter("AccessKeyId", accessKeyId);
}
std::string CreateOTADynamicUpgradeJobRequest::getGroupType()const
{
return groupType_;
}
void CreateOTADynamicUpgradeJobRequest::setGroupType(const std::string& groupType)
{
groupType_ = groupType;
setParameter("GroupType", groupType);
}
bool CreateOTADynamicUpgradeJobRequest::getNeedPush()const
{
return needPush_;
@@ -104,6 +115,17 @@ void CreateOTADynamicUpgradeJobRequest::setIotInstanceId(const std::string& iotI
setParameter("IotInstanceId", iotInstanceId);
}
std::string CreateOTADynamicUpgradeJobRequest::getDownloadProtocol()const
{
return downloadProtocol_;
}
void CreateOTADynamicUpgradeJobRequest::setDownloadProtocol(const std::string& downloadProtocol)
{
downloadProtocol_ = downloadProtocol;
setParameter("DownloadProtocol", downloadProtocol);
}
std::vector<CreateOTADynamicUpgradeJobRequest::Tag> CreateOTADynamicUpgradeJobRequest::getTag()const
{
return tag_;
@@ -120,6 +142,17 @@ void CreateOTADynamicUpgradeJobRequest::setTag(const std::vector<Tag>& tag)
}
}
std::string CreateOTADynamicUpgradeJobRequest::getGroupId()const
{
return groupId_;
}
void CreateOTADynamicUpgradeJobRequest::setGroupId(const std::string& groupId)
{
groupId_ = groupId;
setParameter("GroupId", groupId);
}
std::string CreateOTADynamicUpgradeJobRequest::getFirmwareId()const
{
return firmwareId_;

View File

@@ -71,6 +71,17 @@ void CreateOTAStaticUpgradeJobRequest::setAccessKeyId(const std::string& accessK
setParameter("AccessKeyId", accessKeyId);
}
std::string CreateOTAStaticUpgradeJobRequest::getGroupType()const
{
return groupType_;
}
void CreateOTAStaticUpgradeJobRequest::setGroupType(const std::string& groupType)
{
groupType_ = groupType;
setParameter("GroupType", groupType);
}
bool CreateOTAStaticUpgradeJobRequest::getNeedPush()const
{
return needPush_;
@@ -93,6 +104,17 @@ void CreateOTAStaticUpgradeJobRequest::setIotInstanceId(const std::string& iotIn
setParameter("IotInstanceId", iotInstanceId);
}
std::string CreateOTAStaticUpgradeJobRequest::getDownloadProtocol()const
{
return downloadProtocol_;
}
void CreateOTAStaticUpgradeJobRequest::setDownloadProtocol(const std::string& downloadProtocol)
{
downloadProtocol_ = downloadProtocol;
setParameter("DownloadProtocol", downloadProtocol);
}
std::string CreateOTAStaticUpgradeJobRequest::getTargetSelection()const
{
return targetSelection_;
@@ -153,6 +175,17 @@ void CreateOTAStaticUpgradeJobRequest::setDnListFileUrl(const std::string& dnLis
setParameter("DnListFileUrl", dnListFileUrl);
}
std::string CreateOTAStaticUpgradeJobRequest::getGroupId()const
{
return groupId_;
}
void CreateOTAStaticUpgradeJobRequest::setGroupId(const std::string& groupId)
{
groupId_ = groupId;
setParameter("GroupId", groupId);
}
std::string CreateOTAStaticUpgradeJobRequest::getFirmwareId()const
{
return firmwareId_;

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/iot/model/DeleteDeviceDynamicGroupRequest.h>
using AlibabaCloud::Iot::Model::DeleteDeviceDynamicGroupRequest;
DeleteDeviceDynamicGroupRequest::DeleteDeviceDynamicGroupRequest() :
RpcServiceRequest("iot", "2018-01-20", "DeleteDeviceDynamicGroup")
{
setMethod(HttpRequest::Method::Post);
}
DeleteDeviceDynamicGroupRequest::~DeleteDeviceDynamicGroupRequest()
{}
std::string DeleteDeviceDynamicGroupRequest::getIotInstanceId()const
{
return iotInstanceId_;
}
void DeleteDeviceDynamicGroupRequest::setIotInstanceId(const std::string& iotInstanceId)
{
iotInstanceId_ = iotInstanceId;
setParameter("IotInstanceId", iotInstanceId);
}
std::string DeleteDeviceDynamicGroupRequest::getGroupId()const
{
return groupId_;
}
void DeleteDeviceDynamicGroupRequest::setGroupId(const std::string& groupId)
{
groupId_ = groupId;
setParameter("GroupId", groupId);
}
std::string DeleteDeviceDynamicGroupRequest::getApiProduct()const
{
return apiProduct_;
}
void DeleteDeviceDynamicGroupRequest::setApiProduct(const std::string& apiProduct)
{
apiProduct_ = apiProduct;
setBodyParameter("ApiProduct", apiProduct);
}
std::string DeleteDeviceDynamicGroupRequest::getApiRevision()const
{
return apiRevision_;
}
void DeleteDeviceDynamicGroupRequest::setApiRevision(const std::string& apiRevision)
{
apiRevision_ = apiRevision;
setBodyParameter("ApiRevision", apiRevision);
}

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/iot/model/DeleteDeviceDynamicGroupResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Iot;
using namespace AlibabaCloud::Iot::Model;
DeleteDeviceDynamicGroupResult::DeleteDeviceDynamicGroupResult() :
ServiceResult()
{}
DeleteDeviceDynamicGroupResult::DeleteDeviceDynamicGroupResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
DeleteDeviceDynamicGroupResult::~DeleteDeviceDynamicGroupResult()
{}
void DeleteDeviceDynamicGroupResult::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 DeleteDeviceDynamicGroupResult::getErrorMessage()const
{
return errorMessage_;
}
std::string DeleteDeviceDynamicGroupResult::getCode()const
{
return code_;
}
bool DeleteDeviceDynamicGroupResult::getSuccess()const
{
return success_;
}

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/iot/model/DeleteDeviceTunnelRequest.h>
using AlibabaCloud::Iot::Model::DeleteDeviceTunnelRequest;
DeleteDeviceTunnelRequest::DeleteDeviceTunnelRequest() :
RpcServiceRequest("iot", "2018-01-20", "DeleteDeviceTunnel")
{
setMethod(HttpRequest::Method::Post);
}
DeleteDeviceTunnelRequest::~DeleteDeviceTunnelRequest()
{}
std::string DeleteDeviceTunnelRequest::getIotInstanceId()const
{
return iotInstanceId_;
}
void DeleteDeviceTunnelRequest::setIotInstanceId(const std::string& iotInstanceId)
{
iotInstanceId_ = iotInstanceId;
setParameter("IotInstanceId", iotInstanceId);
}
std::string DeleteDeviceTunnelRequest::getTunnelId()const
{
return tunnelId_;
}
void DeleteDeviceTunnelRequest::setTunnelId(const std::string& tunnelId)
{
tunnelId_ = tunnelId;
setParameter("TunnelId", tunnelId);
}
std::string DeleteDeviceTunnelRequest::getApiProduct()const
{
return apiProduct_;
}
void DeleteDeviceTunnelRequest::setApiProduct(const std::string& apiProduct)
{
apiProduct_ = apiProduct;
setBodyParameter("ApiProduct", apiProduct);
}
std::string DeleteDeviceTunnelRequest::getApiRevision()const
{
return apiRevision_;
}
void DeleteDeviceTunnelRequest::setApiRevision(const std::string& apiRevision)
{
apiRevision_ = apiRevision;
setBodyParameter("ApiRevision", apiRevision);
}

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/iot/model/DeleteDeviceTunnelResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Iot;
using namespace AlibabaCloud::Iot::Model;
DeleteDeviceTunnelResult::DeleteDeviceTunnelResult() :
ServiceResult()
{}
DeleteDeviceTunnelResult::DeleteDeviceTunnelResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
DeleteDeviceTunnelResult::~DeleteDeviceTunnelResult()
{}
void DeleteDeviceTunnelResult::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 DeleteDeviceTunnelResult::getErrorMessage()const
{
return errorMessage_;
}
std::string DeleteDeviceTunnelResult::getCode()const
{
return code_;
}
bool DeleteDeviceTunnelResult::getSuccess()const
{
return success_;
}

View File

@@ -0,0 +1,117 @@
/*
* 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);
}

View File

@@ -0,0 +1,125 @@
/*
* 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_;
}

View File

@@ -51,6 +51,8 @@ void QueryDeviceGroupByDeviceResult::parse(const std::string &payload)
groupInfosObject.utcCreate = valueGroupInfosGroupInfo["UtcCreate"].asString();
if(!valueGroupInfosGroupInfo["GroupDesc"].isNull())
groupInfosObject.groupDesc = valueGroupInfosGroupInfo["GroupDesc"].asString();
if(!valueGroupInfosGroupInfo["GroupType"].isNull())
groupInfosObject.groupType = valueGroupInfosGroupInfo["GroupType"].asString();
groupInfos_.push_back(groupInfosObject);
}
if(!value["Success"].isNull())

View File

@@ -60,6 +60,17 @@ void QueryDeviceGroupInfoRequest::setRealTripartiteKey(const std::string& realTr
setParameter("RealTripartiteKey", realTripartiteKey);
}
std::string QueryDeviceGroupInfoRequest::getGroupType()const
{
return groupType_;
}
void QueryDeviceGroupInfoRequest::setGroupType(const std::string& groupType)
{
groupType_ = groupType;
setParameter("GroupType", groupType);
}
std::string QueryDeviceGroupInfoRequest::getIotInstanceId()const
{
return iotInstanceId_;

View File

@@ -54,6 +54,8 @@ void QueryDeviceGroupInfoResult::parse(const std::string &payload)
data_.deviceActive = std::stoi(dataNode["DeviceActive"].asString());
if(!dataNode["DeviceOnline"].isNull())
data_.deviceOnline = std::stoi(dataNode["DeviceOnline"].asString());
if(!dataNode["DynamicGroupExpression"].isNull())
data_.dynamicGroupExpression = dataNode["DynamicGroupExpression"].asString();
if(!value["Success"].isNull())
success_ = value["Success"].asString() == "true";
if(!value["Code"].isNull())

View File

@@ -27,6 +27,19 @@ QueryDeviceGroupListRequest::QueryDeviceGroupListRequest() :
QueryDeviceGroupListRequest::~QueryDeviceGroupListRequest()
{}
std::vector<std::string> QueryDeviceGroupListRequest::getGroupTypes()const
{
return groupTypes_;
}
void QueryDeviceGroupListRequest::setGroupTypes(const std::vector<std::string>& groupTypes)
{
groupTypes_ = groupTypes;
for(int dep1 = 0; dep1!= groupTypes.size(); dep1++) {
setParameter("GroupTypes."+ std::to_string(dep1), groupTypes.at(dep1));
}
}
std::string QueryDeviceGroupListRequest::getSuperGroupId()const
{
return superGroupId_;

View File

@@ -51,6 +51,8 @@ void QueryDeviceGroupListResult::parse(const std::string &payload)
dataObject.groupName = valueDataGroupInfo["GroupName"].asString();
if(!valueDataGroupInfo["GroupDesc"].isNull())
dataObject.groupDesc = valueDataGroupInfo["GroupDesc"].asString();
if(!valueDataGroupInfo["GroupType"].isNull())
dataObject.groupType = valueDataGroupInfo["GroupType"].asString();
data_.push_back(dataObject);
}
if(!value["Success"].isNull())

View File

@@ -38,6 +38,17 @@ void QueryDeviceGroupTagListRequest::setAccessKeyId(const std::string& accessKey
setParameter("AccessKeyId", accessKeyId);
}
std::string QueryDeviceGroupTagListRequest::getGroupType()const
{
return groupType_;
}
void QueryDeviceGroupTagListRequest::setGroupType(const std::string& groupType)
{
groupType_ = groupType;
setParameter("GroupType", groupType);
}
std::string QueryDeviceGroupTagListRequest::getIotInstanceId()const
{
return iotInstanceId_;

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/iot/model/QueryDeviceTunnelRequest.h>
using AlibabaCloud::Iot::Model::QueryDeviceTunnelRequest;
QueryDeviceTunnelRequest::QueryDeviceTunnelRequest() :
RpcServiceRequest("iot", "2018-01-20", "QueryDeviceTunnel")
{
setMethod(HttpRequest::Method::Post);
}
QueryDeviceTunnelRequest::~QueryDeviceTunnelRequest()
{}
std::string QueryDeviceTunnelRequest::getIotInstanceId()const
{
return iotInstanceId_;
}
void QueryDeviceTunnelRequest::setIotInstanceId(const std::string& iotInstanceId)
{
iotInstanceId_ = iotInstanceId;
setParameter("IotInstanceId", iotInstanceId);
}
std::string QueryDeviceTunnelRequest::getTunnelId()const
{
return tunnelId_;
}
void QueryDeviceTunnelRequest::setTunnelId(const std::string& tunnelId)
{
tunnelId_ = tunnelId;
setParameter("TunnelId", tunnelId);
}
std::string QueryDeviceTunnelRequest::getApiProduct()const
{
return apiProduct_;
}
void QueryDeviceTunnelRequest::setApiProduct(const std::string& apiProduct)
{
apiProduct_ = apiProduct;
setBodyParameter("ApiProduct", apiProduct);
}
std::string QueryDeviceTunnelRequest::getApiRevision()const
{
return apiRevision_;
}
void QueryDeviceTunnelRequest::setApiRevision(const std::string& apiRevision)
{
apiRevision_ = apiRevision;
setBodyParameter("ApiRevision", apiRevision);
}

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/iot/model/QueryDeviceTunnelResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Iot;
using namespace AlibabaCloud::Iot::Model;
QueryDeviceTunnelResult::QueryDeviceTunnelResult() :
ServiceResult()
{}
QueryDeviceTunnelResult::QueryDeviceTunnelResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
QueryDeviceTunnelResult::~QueryDeviceTunnelResult()
{}
void QueryDeviceTunnelResult::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["TunnelId"].isNull())
data_.tunnelId = dataNode["TunnelId"].asString();
if(!dataNode["TunnelState"].isNull())
data_.tunnelState = dataNode["TunnelState"].asString();
if(!dataNode["ProductKey"].isNull())
data_.productKey = dataNode["ProductKey"].asString();
if(!dataNode["DeviceName"].isNull())
data_.deviceName = dataNode["DeviceName"].asString();
if(!dataNode["IotId"].isNull())
data_.iotId = dataNode["IotId"].asString();
if(!dataNode["DeviceConnState"].isNull())
data_.deviceConnState = dataNode["DeviceConnState"].asString();
if(!dataNode["SourceConnState"].isNull())
data_.sourceConnState = dataNode["SourceConnState"].asString();
if(!dataNode["Udi"].isNull())
data_.udi = dataNode["Udi"].asString();
if(!dataNode["Description"].isNull())
data_.description = dataNode["Description"].asString();
if(!dataNode["UtcCreated"].isNull())
data_.utcCreated = dataNode["UtcCreated"].asString();
if(!dataNode["UtcClosed"].isNull())
data_.utcClosed = dataNode["UtcClosed"].asString();
if(!dataNode["ProductName"].isNull())
data_.productName = dataNode["ProductName"].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();
}
QueryDeviceTunnelResult::Data QueryDeviceTunnelResult::getData()const
{
return data_;
}
std::string QueryDeviceTunnelResult::getErrorMessage()const
{
return errorMessage_;
}
std::string QueryDeviceTunnelResult::getCode()const
{
return code_;
}
bool QueryDeviceTunnelResult::getSuccess()const
{
return success_;
}

View File

@@ -0,0 +1,150 @@
/*
* 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/QueryDynamicGroupDevicesRequest.h>
using AlibabaCloud::Iot::Model::QueryDynamicGroupDevicesRequest;
QueryDynamicGroupDevicesRequest::QueryDynamicGroupDevicesRequest() :
RpcServiceRequest("iot", "2018-01-20", "QueryDynamicGroupDevices")
{
setMethod(HttpRequest::Method::Post);
}
QueryDynamicGroupDevicesRequest::~QueryDynamicGroupDevicesRequest()
{}
std::string QueryDynamicGroupDevicesRequest::getNextToken()const
{
return nextToken_;
}
void QueryDynamicGroupDevicesRequest::setNextToken(const std::string& nextToken)
{
nextToken_ = nextToken;
setParameter("NextToken", nextToken);
}
std::string QueryDynamicGroupDevicesRequest::getIotInstanceId()const
{
return iotInstanceId_;
}
void QueryDynamicGroupDevicesRequest::setIotInstanceId(const std::string& iotInstanceId)
{
iotInstanceId_ = iotInstanceId;
setParameter("IotInstanceId", iotInstanceId);
}
int QueryDynamicGroupDevicesRequest::getPageSize()const
{
return pageSize_;
}
void QueryDynamicGroupDevicesRequest::setPageSize(int pageSize)
{
pageSize_ = pageSize;
setParameter("PageSize", std::to_string(pageSize));
}
bool QueryDynamicGroupDevicesRequest::getFuzzyName()const
{
return fuzzyName_;
}
void QueryDynamicGroupDevicesRequest::setFuzzyName(bool fuzzyName)
{
fuzzyName_ = fuzzyName;
setParameter("FuzzyName", fuzzyName ? "true" : "false");
}
std::string QueryDynamicGroupDevicesRequest::getGroupId()const
{
return groupId_;
}
void QueryDynamicGroupDevicesRequest::setGroupId(const std::string& groupId)
{
groupId_ = groupId;
setParameter("GroupId", groupId);
}
int QueryDynamicGroupDevicesRequest::getCurrentPage()const
{
return currentPage_;
}
void QueryDynamicGroupDevicesRequest::setCurrentPage(int currentPage)
{
currentPage_ = currentPage;
setParameter("CurrentPage", std::to_string(currentPage));
}
std::string QueryDynamicGroupDevicesRequest::getProductKey()const
{
return productKey_;
}
void QueryDynamicGroupDevicesRequest::setProductKey(const std::string& productKey)
{
productKey_ = productKey;
setParameter("ProductKey", productKey);
}
std::string QueryDynamicGroupDevicesRequest::getApiProduct()const
{
return apiProduct_;
}
void QueryDynamicGroupDevicesRequest::setApiProduct(const std::string& apiProduct)
{
apiProduct_ = apiProduct;
setBodyParameter("ApiProduct", apiProduct);
}
std::string QueryDynamicGroupDevicesRequest::getApiRevision()const
{
return apiRevision_;
}
void QueryDynamicGroupDevicesRequest::setApiRevision(const std::string& apiRevision)
{
apiRevision_ = apiRevision;
setBodyParameter("ApiRevision", apiRevision);
}
std::string QueryDynamicGroupDevicesRequest::getDeviceName()const
{
return deviceName_;
}
void QueryDynamicGroupDevicesRequest::setDeviceName(const std::string& deviceName)
{
deviceName_ = deviceName;
setParameter("DeviceName", deviceName);
}
std::string QueryDynamicGroupDevicesRequest::getStatus()const
{
return status_;
}
void QueryDynamicGroupDevicesRequest::setStatus(const std::string& status)
{
status_ = status;
setParameter("Status", status);
}

View File

@@ -0,0 +1,135 @@
/*
* 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/QueryDynamicGroupDevicesResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Iot;
using namespace AlibabaCloud::Iot::Model;
QueryDynamicGroupDevicesResult::QueryDynamicGroupDevicesResult() :
ServiceResult()
{}
QueryDynamicGroupDevicesResult::QueryDynamicGroupDevicesResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
QueryDynamicGroupDevicesResult::~QueryDynamicGroupDevicesResult()
{}
void QueryDynamicGroupDevicesResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto allDataNode = value["Data"]["SimpleDeviceInfo"];
for (auto valueDataSimpleDeviceInfo : allDataNode)
{
SimpleDeviceInfo dataObject;
if(!valueDataSimpleDeviceInfo["ProductName"].isNull())
dataObject.productName = valueDataSimpleDeviceInfo["ProductName"].asString();
if(!valueDataSimpleDeviceInfo["ProductKey"].isNull())
dataObject.productKey = valueDataSimpleDeviceInfo["ProductKey"].asString();
if(!valueDataSimpleDeviceInfo["DeviceName"].isNull())
dataObject.deviceName = valueDataSimpleDeviceInfo["DeviceName"].asString();
if(!valueDataSimpleDeviceInfo["CategoryKey"].isNull())
dataObject.categoryKey = valueDataSimpleDeviceInfo["CategoryKey"].asString();
if(!valueDataSimpleDeviceInfo["NodeType"].isNull())
dataObject.nodeType = std::stoi(valueDataSimpleDeviceInfo["NodeType"].asString());
if(!valueDataSimpleDeviceInfo["Status"].isNull())
dataObject.status = valueDataSimpleDeviceInfo["Status"].asString();
if(!valueDataSimpleDeviceInfo["IotId"].isNull())
dataObject.iotId = valueDataSimpleDeviceInfo["IotId"].asString();
if(!valueDataSimpleDeviceInfo["ActiveTime"].isNull())
dataObject.activeTime = valueDataSimpleDeviceInfo["ActiveTime"].asString();
if(!valueDataSimpleDeviceInfo["UtcActiveTime"].isNull())
dataObject.utcActiveTime = valueDataSimpleDeviceInfo["UtcActiveTime"].asString();
if(!valueDataSimpleDeviceInfo["LastOnlineTime"].isNull())
dataObject.lastOnlineTime = valueDataSimpleDeviceInfo["LastOnlineTime"].asString();
if(!valueDataSimpleDeviceInfo["UtcLastOnlineTime"].isNull())
dataObject.utcLastOnlineTime = valueDataSimpleDeviceInfo["UtcLastOnlineTime"].asString();
if(!valueDataSimpleDeviceInfo["Nickname"].isNull())
dataObject.nickname = valueDataSimpleDeviceInfo["Nickname"].asString();
data_.push_back(dataObject);
}
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();
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());
if(!value["NextToken"].isNull())
nextToken_ = value["NextToken"].asString();
}
int QueryDynamicGroupDevicesResult::getPageSize()const
{
return pageSize_;
}
int QueryDynamicGroupDevicesResult::getPageCount()const
{
return pageCount_;
}
std::string QueryDynamicGroupDevicesResult::getNextToken()const
{
return nextToken_;
}
int QueryDynamicGroupDevicesResult::getTotal()const
{
return total_;
}
std::vector<QueryDynamicGroupDevicesResult::SimpleDeviceInfo> QueryDynamicGroupDevicesResult::getData()const
{
return data_;
}
int QueryDynamicGroupDevicesResult::getPage()const
{
return page_;
}
std::string QueryDynamicGroupDevicesResult::getErrorMessage()const
{
return errorMessage_;
}
std::string QueryDynamicGroupDevicesResult::getCode()const
{
return code_;
}
bool QueryDynamicGroupDevicesResult::getSuccess()const
{
return success_;
}

View File

@@ -70,6 +70,8 @@ void QueryEdgeDriverResult::parse(const std::string &payload)
driverObject.gmtModifiedTimestamp = std::stol(dataNodeDriverListDriver["GmtModifiedTimestamp"].asString());
if(!dataNodeDriverListDriver["IsApply"].isNull())
driverObject.isApply = dataNodeDriverListDriver["IsApply"].asString() == "true";
if(!dataNodeDriverListDriver["UseOfficialConfig"].isNull())
driverObject.useOfficialConfig = std::stoi(dataNodeDriverListDriver["UseOfficialConfig"].asString());
data_.driverList.push_back(driverObject);
}
if(!value["Success"].isNull())

View File

@@ -90,6 +90,12 @@ void QueryOTAJobResult::parse(const std::string &payload)
data_.needPush = dataNode["NeedPush"].asString() == "true";
if(!dataNode["NeedConfirm"].isNull())
data_.needConfirm = dataNode["NeedConfirm"].asString() == "true";
if(!dataNode["GroupId"].isNull())
data_.groupId = dataNode["GroupId"].asString();
if(!dataNode["GroupName"].isNull())
data_.groupName = dataNode["GroupName"].asString();
if(!dataNode["DownloadProtocol"].isNull())
data_.downloadProtocol = dataNode["DownloadProtocol"].asString();
auto allTagsNode = dataNode["Tags"]["OtaTagDTO"];
for (auto dataNodeTagsOtaTagDTO : allTagsNode)
{

View File

@@ -38,6 +38,17 @@ void SetDeviceGroupTagsRequest::setAccessKeyId(const std::string& accessKeyId)
setParameter("AccessKeyId", accessKeyId);
}
std::string SetDeviceGroupTagsRequest::getGroupType()const
{
return groupType_;
}
void SetDeviceGroupTagsRequest::setGroupType(const std::string& groupType)
{
groupType_ = groupType;
setParameter("GroupType", groupType);
}
std::string SetDeviceGroupTagsRequest::getIotInstanceId()const
{
return iotInstanceId_;

View File

@@ -39,6 +39,9 @@ void SubscribeTopicResult::parse(const std::string &payload)
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto allFailureTopics = value["FailureTopics"]["topic"];
for (const auto &item : allFailureTopics)
failureTopics_.push_back(item.asString());
if(!value["Success"].isNull())
success_ = value["Success"].asString() == "true";
if(!value["Code"].isNull())
@@ -48,6 +51,11 @@ void SubscribeTopicResult::parse(const std::string &payload)
}
std::vector<std::string> SubscribeTopicResult::getFailureTopics()const
{
return failureTopics_;
}
std::string SubscribeTopicResult::getErrorMessage()const
{
return errorMessage_;

View File

@@ -38,6 +38,17 @@ void UpdateDeviceGroupRequest::setAccessKeyId(const std::string& accessKeyId)
setParameter("AccessKeyId", accessKeyId);
}
std::string UpdateDeviceGroupRequest::getGroupType()const
{
return groupType_;
}
void UpdateDeviceGroupRequest::setGroupType(const std::string& groupType)
{
groupType_ = groupType;
setParameter("GroupType", groupType);
}
std::string UpdateDeviceGroupRequest::getIotInstanceId()const
{
return iotInstanceId_;