IOT SDK Auto Released By yuxing.liyuxing,Version:1.27.1
Signed-off-by: yixiong.jxy <yixiong.jxy@alibaba-inc.com>
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
2018-09-28 Version: 1.27.1
|
||||
1, Add one api, QueryAppDeviceList.
|
||||
|
||||
2018-09-27 Version: 1.27.0
|
||||
1, Add new API ListQueues, modify API SetAutoScaleConfig to support queue related features.
|
||||
|
||||
|
||||
@@ -21,6 +21,8 @@ set(iot_public_header
|
||||
include/alibabacloud/iot/IotExport.h )
|
||||
|
||||
set(iot_public_header_model
|
||||
include/alibabacloud/iot/model/QueryAppDeviceListRequest.h
|
||||
include/alibabacloud/iot/model/QueryAppDeviceListResult.h
|
||||
include/alibabacloud/iot/model/DeleteTopicRouteTableRequest.h
|
||||
include/alibabacloud/iot/model/DeleteTopicRouteTableResult.h
|
||||
include/alibabacloud/iot/model/QueryDeviceEventDataRequest.h
|
||||
@@ -55,6 +57,8 @@ set(iot_public_header_model
|
||||
include/alibabacloud/iot/model/DeleteDevicePropResult.h
|
||||
include/alibabacloud/iot/model/StopRuleRequest.h
|
||||
include/alibabacloud/iot/model/StopRuleResult.h
|
||||
include/alibabacloud/iot/model/QueryDeviceGroupByDeviceRequest.h
|
||||
include/alibabacloud/iot/model/QueryDeviceGroupByDeviceResult.h
|
||||
include/alibabacloud/iot/model/QueryDeviceDetailRequest.h
|
||||
include/alibabacloud/iot/model/QueryDeviceDetailResult.h
|
||||
include/alibabacloud/iot/model/NotifyAddThingTopoRequest.h
|
||||
@@ -138,6 +142,8 @@ set(iot_public_header_model
|
||||
|
||||
set(iot_src
|
||||
src/IotClient.cc
|
||||
src/model/QueryAppDeviceListRequest.cc
|
||||
src/model/QueryAppDeviceListResult.cc
|
||||
src/model/DeleteTopicRouteTableRequest.cc
|
||||
src/model/DeleteTopicRouteTableResult.cc
|
||||
src/model/QueryDeviceEventDataRequest.cc
|
||||
@@ -172,6 +178,8 @@ set(iot_src
|
||||
src/model/DeleteDevicePropResult.cc
|
||||
src/model/StopRuleRequest.cc
|
||||
src/model/StopRuleResult.cc
|
||||
src/model/QueryDeviceGroupByDeviceRequest.cc
|
||||
src/model/QueryDeviceGroupByDeviceResult.cc
|
||||
src/model/QueryDeviceDetailRequest.cc
|
||||
src/model/QueryDeviceDetailResult.cc
|
||||
src/model/NotifyAddThingTopoRequest.cc
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
#include <alibabacloud/core/EndpointProvider.h>
|
||||
#include <alibabacloud/core/RpcServiceClient.h>
|
||||
#include "IotExport.h"
|
||||
#include "model/QueryAppDeviceListRequest.h"
|
||||
#include "model/QueryAppDeviceListResult.h"
|
||||
#include "model/DeleteTopicRouteTableRequest.h"
|
||||
#include "model/DeleteTopicRouteTableResult.h"
|
||||
#include "model/QueryDeviceEventDataRequest.h"
|
||||
@@ -56,6 +58,8 @@
|
||||
#include "model/DeleteDevicePropResult.h"
|
||||
#include "model/StopRuleRequest.h"
|
||||
#include "model/StopRuleResult.h"
|
||||
#include "model/QueryDeviceGroupByDeviceRequest.h"
|
||||
#include "model/QueryDeviceGroupByDeviceResult.h"
|
||||
#include "model/QueryDeviceDetailRequest.h"
|
||||
#include "model/QueryDeviceDetailResult.h"
|
||||
#include "model/NotifyAddThingTopoRequest.h"
|
||||
@@ -145,6 +149,9 @@ namespace AlibabaCloud
|
||||
class ALIBABACLOUD_IOT_EXPORT IotClient : public RpcServiceClient
|
||||
{
|
||||
public:
|
||||
typedef Outcome<Error, Model::QueryAppDeviceListResult> QueryAppDeviceListOutcome;
|
||||
typedef std::future<QueryAppDeviceListOutcome> QueryAppDeviceListOutcomeCallable;
|
||||
typedef std::function<void(const IotClient*, const Model::QueryAppDeviceListRequest&, const QueryAppDeviceListOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> QueryAppDeviceListAsyncHandler;
|
||||
typedef Outcome<Error, Model::DeleteTopicRouteTableResult> DeleteTopicRouteTableOutcome;
|
||||
typedef std::future<DeleteTopicRouteTableOutcome> DeleteTopicRouteTableOutcomeCallable;
|
||||
typedef std::function<void(const IotClient*, const Model::DeleteTopicRouteTableRequest&, const DeleteTopicRouteTableOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DeleteTopicRouteTableAsyncHandler;
|
||||
@@ -196,6 +203,9 @@ namespace AlibabaCloud
|
||||
typedef Outcome<Error, Model::StopRuleResult> StopRuleOutcome;
|
||||
typedef std::future<StopRuleOutcome> StopRuleOutcomeCallable;
|
||||
typedef std::function<void(const IotClient*, const Model::StopRuleRequest&, const StopRuleOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> StopRuleAsyncHandler;
|
||||
typedef Outcome<Error, Model::QueryDeviceGroupByDeviceResult> QueryDeviceGroupByDeviceOutcome;
|
||||
typedef std::future<QueryDeviceGroupByDeviceOutcome> QueryDeviceGroupByDeviceOutcomeCallable;
|
||||
typedef std::function<void(const IotClient*, const Model::QueryDeviceGroupByDeviceRequest&, const QueryDeviceGroupByDeviceOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> QueryDeviceGroupByDeviceAsyncHandler;
|
||||
typedef Outcome<Error, Model::QueryDeviceDetailResult> QueryDeviceDetailOutcome;
|
||||
typedef std::future<QueryDeviceDetailOutcome> QueryDeviceDetailOutcomeCallable;
|
||||
typedef std::function<void(const IotClient*, const Model::QueryDeviceDetailRequest&, const QueryDeviceDetailOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> QueryDeviceDetailAsyncHandler;
|
||||
@@ -321,6 +331,9 @@ namespace AlibabaCloud
|
||||
IotClient(const std::shared_ptr<CredentialsProvider> &credentialsProvider, const ClientConfiguration &configuration);
|
||||
IotClient(const std::string &accessKeyId, const std::string &accessKeySecret, const ClientConfiguration &configuration);
|
||||
~IotClient();
|
||||
QueryAppDeviceListOutcome queryAppDeviceList(const Model::QueryAppDeviceListRequest &request)const;
|
||||
void queryAppDeviceListAsync(const Model::QueryAppDeviceListRequest& request, const QueryAppDeviceListAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
QueryAppDeviceListOutcomeCallable queryAppDeviceListCallable(const Model::QueryAppDeviceListRequest& request) const;
|
||||
DeleteTopicRouteTableOutcome deleteTopicRouteTable(const Model::DeleteTopicRouteTableRequest &request)const;
|
||||
void deleteTopicRouteTableAsync(const Model::DeleteTopicRouteTableRequest& request, const DeleteTopicRouteTableAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
DeleteTopicRouteTableOutcomeCallable deleteTopicRouteTableCallable(const Model::DeleteTopicRouteTableRequest& request) const;
|
||||
@@ -372,6 +385,9 @@ namespace AlibabaCloud
|
||||
StopRuleOutcome stopRule(const Model::StopRuleRequest &request)const;
|
||||
void stopRuleAsync(const Model::StopRuleRequest& request, const StopRuleAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
StopRuleOutcomeCallable stopRuleCallable(const Model::StopRuleRequest& request) const;
|
||||
QueryDeviceGroupByDeviceOutcome queryDeviceGroupByDevice(const Model::QueryDeviceGroupByDeviceRequest &request)const;
|
||||
void queryDeviceGroupByDeviceAsync(const Model::QueryDeviceGroupByDeviceRequest& request, const QueryDeviceGroupByDeviceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
QueryDeviceGroupByDeviceOutcomeCallable queryDeviceGroupByDeviceCallable(const Model::QueryDeviceGroupByDeviceRequest& request) const;
|
||||
QueryDeviceDetailOutcome queryDeviceDetail(const Model::QueryDeviceDetailRequest &request)const;
|
||||
void queryDeviceDetailAsync(const Model::QueryDeviceDetailRequest& request, const QueryDeviceDetailAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
QueryDeviceDetailOutcomeCallable queryDeviceDetailCallable(const Model::QueryDeviceDetailRequest& request) const;
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_IOT_MODEL_QUERYAPPDEVICELISTREQUEST_H_
|
||||
#define ALIBABACLOUD_IOT_MODEL_QUERYAPPDEVICELISTREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/iot/IotExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Iot
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_IOT_EXPORT QueryAppDeviceListRequest : public RpcServiceRequest
|
||||
{
|
||||
struct TagList
|
||||
{
|
||||
std::string tagName;
|
||||
std::string tagValue;
|
||||
};
|
||||
|
||||
public:
|
||||
QueryAppDeviceListRequest();
|
||||
~QueryAppDeviceListRequest();
|
||||
|
||||
std::vector<std::string> getProductKeyList()const;
|
||||
void setProductKeyList(const std::vector<std::string>& productKeyList);
|
||||
std::vector<std::string> getCategoryKeyList()const;
|
||||
void setCategoryKeyList(const std::vector<std::string>& categoryKeyList);
|
||||
int getPageSize()const;
|
||||
void setPageSize(int pageSize);
|
||||
int getCurrentPage()const;
|
||||
void setCurrentPage(int currentPage);
|
||||
std::string getAppKey()const;
|
||||
void setAppKey(const std::string& appKey);
|
||||
std::vector<TagList> getTagList()const;
|
||||
void setTagList(const std::vector<TagList>& tagList);
|
||||
|
||||
private:
|
||||
std::vector<std::string> productKeyList_;
|
||||
std::vector<std::string> categoryKeyList_;
|
||||
int pageSize_;
|
||||
int currentPage_;
|
||||
std::string appKey_;
|
||||
std::vector<TagList> tagList_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_IOT_MODEL_QUERYAPPDEVICELISTREQUEST_H_
|
||||
@@ -0,0 +1,80 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_IOT_MODEL_QUERYAPPDEVICELISTRESULT_H_
|
||||
#define ALIBABACLOUD_IOT_MODEL_QUERYAPPDEVICELISTRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/iot/IotExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Iot
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_IOT_EXPORT QueryAppDeviceListResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct DataItem
|
||||
{
|
||||
std::string status;
|
||||
std::string lastOnlineTime;
|
||||
std::string utcActiveTime;
|
||||
std::string utcCreateTime;
|
||||
std::string productName;
|
||||
long childDeviceCount;
|
||||
std::string activeTime;
|
||||
std::string utcLastOnlineTime;
|
||||
int nodeType;
|
||||
std::string createTime;
|
||||
std::string productKey;
|
||||
std::string deviceName;
|
||||
};
|
||||
|
||||
|
||||
QueryAppDeviceListResult();
|
||||
explicit QueryAppDeviceListResult(const std::string &payload);
|
||||
~QueryAppDeviceListResult();
|
||||
int getPageSize()const;
|
||||
int getPageCount()const;
|
||||
int getTotal()const;
|
||||
std::vector<DataItem> getData()const;
|
||||
int getPage()const;
|
||||
std::string getErrorMessage()const;
|
||||
std::string getCode()const;
|
||||
bool getSuccess()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
int pageSize_;
|
||||
int pageCount_;
|
||||
int total_;
|
||||
std::vector<DataItem> data_;
|
||||
int page_;
|
||||
std::string errorMessage_;
|
||||
std::string code_;
|
||||
bool success_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_IOT_MODEL_QUERYAPPDEVICELISTRESULT_H_
|
||||
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_IOT_MODEL_QUERYDEVICEGROUPBYDEVICEREQUEST_H_
|
||||
#define ALIBABACLOUD_IOT_MODEL_QUERYDEVICEGROUPBYDEVICEREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/iot/IotExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Iot
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_IOT_EXPORT QueryDeviceGroupByDeviceRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
QueryDeviceGroupByDeviceRequest();
|
||||
~QueryDeviceGroupByDeviceRequest();
|
||||
|
||||
std::string getDeviceName()const;
|
||||
void setDeviceName(const std::string& deviceName);
|
||||
std::string getProductKey()const;
|
||||
void setProductKey(const std::string& productKey);
|
||||
std::string getAccessKeyId()const;
|
||||
void setAccessKeyId(const std::string& accessKeyId);
|
||||
|
||||
private:
|
||||
std::string deviceName_;
|
||||
std::string productKey_;
|
||||
std::string accessKeyId_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_IOT_MODEL_QUERYDEVICEGROUPBYDEVICEREQUEST_H_
|
||||
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_IOT_MODEL_QUERYDEVICEGROUPBYDEVICERESULT_H_
|
||||
#define ALIBABACLOUD_IOT_MODEL_QUERYDEVICEGROUPBYDEVICERESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/iot/IotExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Iot
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_IOT_EXPORT QueryDeviceGroupByDeviceResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct GroupInfo
|
||||
{
|
||||
std::string groupName;
|
||||
std::string utcCreate;
|
||||
std::string groupDesc;
|
||||
std::string groupId;
|
||||
};
|
||||
|
||||
|
||||
QueryDeviceGroupByDeviceResult();
|
||||
explicit QueryDeviceGroupByDeviceResult(const std::string &payload);
|
||||
~QueryDeviceGroupByDeviceResult();
|
||||
std::vector<GroupInfo> getGroupInfos()const;
|
||||
std::string getErrorMessage()const;
|
||||
std::string getCode()const;
|
||||
bool getSuccess()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::vector<GroupInfo> groupInfos_;
|
||||
std::string errorMessage_;
|
||||
std::string code_;
|
||||
bool success_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_IOT_MODEL_QUERYDEVICEGROUPBYDEVICERESULT_H_
|
||||
@@ -51,6 +51,42 @@ IotClient::IotClient(const std::string & accessKeyId, const std::string & access
|
||||
IotClient::~IotClient()
|
||||
{}
|
||||
|
||||
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::DeleteTopicRouteTableOutcome IotClient::deleteTopicRouteTable(const DeleteTopicRouteTableRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
@@ -663,6 +699,42 @@ IotClient::StopRuleOutcomeCallable IotClient::stopRuleCallable(const StopRuleReq
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
IotClient::QueryDeviceGroupByDeviceOutcome IotClient::queryDeviceGroupByDevice(const QueryDeviceGroupByDeviceRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return QueryDeviceGroupByDeviceOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return QueryDeviceGroupByDeviceOutcome(QueryDeviceGroupByDeviceResult(outcome.result()));
|
||||
else
|
||||
return QueryDeviceGroupByDeviceOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void IotClient::queryDeviceGroupByDeviceAsync(const QueryDeviceGroupByDeviceRequest& request, const QueryDeviceGroupByDeviceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, queryDeviceGroupByDevice(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
IotClient::QueryDeviceGroupByDeviceOutcomeCallable IotClient::queryDeviceGroupByDeviceCallable(const QueryDeviceGroupByDeviceRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<QueryDeviceGroupByDeviceOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->queryDeviceGroupByDevice(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
IotClient::QueryDeviceDetailOutcome IotClient::queryDeviceDetail(const QueryDeviceDetailRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
|
||||
101
iot/src/model/QueryAppDeviceListRequest.cc
Normal file
101
iot/src/model/QueryAppDeviceListRequest.cc
Normal file
@@ -0,0 +1,101 @@
|
||||
/*
|
||||
* 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")
|
||||
{}
|
||||
|
||||
QueryAppDeviceListRequest::~QueryAppDeviceListRequest()
|
||||
{}
|
||||
|
||||
std::vector<std::string> QueryAppDeviceListRequest::getProductKeyList()const
|
||||
{
|
||||
return productKeyList_;
|
||||
}
|
||||
|
||||
void QueryAppDeviceListRequest::setProductKeyList(const std::vector<std::string>& productKeyList)
|
||||
{
|
||||
productKeyList_ = productKeyList;
|
||||
for(int i = 0; i!= productKeyList.size(); i++)
|
||||
setParameter("ProductKeyList."+ std::to_string(i), productKeyList.at(i));
|
||||
}
|
||||
|
||||
std::vector<std::string> QueryAppDeviceListRequest::getCategoryKeyList()const
|
||||
{
|
||||
return categoryKeyList_;
|
||||
}
|
||||
|
||||
void QueryAppDeviceListRequest::setCategoryKeyList(const std::vector<std::string>& categoryKeyList)
|
||||
{
|
||||
categoryKeyList_ = categoryKeyList;
|
||||
for(int i = 0; i!= categoryKeyList.size(); i++)
|
||||
setParameter("CategoryKeyList."+ std::to_string(i), categoryKeyList.at(i));
|
||||
}
|
||||
|
||||
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::string QueryAppDeviceListRequest::getAppKey()const
|
||||
{
|
||||
return appKey_;
|
||||
}
|
||||
|
||||
void QueryAppDeviceListRequest::setAppKey(const std::string& appKey)
|
||||
{
|
||||
appKey_ = appKey;
|
||||
setParameter("AppKey", appKey);
|
||||
}
|
||||
|
||||
std::vector<QueryAppDeviceListRequest::TagList> QueryAppDeviceListRequest::getTagList()const
|
||||
{
|
||||
return tagList_;
|
||||
}
|
||||
|
||||
void QueryAppDeviceListRequest::setTagList(const std::vector<TagList>& tagList)
|
||||
{
|
||||
tagList_ = tagList;
|
||||
int i = 0;
|
||||
for(int i = 0; i!= tagList.size(); i++) {
|
||||
auto obj = tagList.at(i);
|
||||
std::string str ="TagList."+ std::to_string(i);
|
||||
setParameter(str + ".TagName", obj.tagName);
|
||||
setParameter(str + ".TagValue", obj.tagValue);
|
||||
}
|
||||
}
|
||||
|
||||
129
iot/src/model/QueryAppDeviceListResult.cc
Normal file
129
iot/src/model/QueryAppDeviceListResult.cc
Normal file
@@ -0,0 +1,129 @@
|
||||
/*
|
||||
* 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 allData = value["Data"]["DataItem"];
|
||||
for (auto value : allData)
|
||||
{
|
||||
DataItem dataObject;
|
||||
if(!value["ProductName"].isNull())
|
||||
dataObject.productName = value["ProductName"].asString();
|
||||
if(!value["ProductKey"].isNull())
|
||||
dataObject.productKey = value["ProductKey"].asString();
|
||||
if(!value["DeviceName"].isNull())
|
||||
dataObject.deviceName = value["DeviceName"].asString();
|
||||
if(!value["NodeType"].isNull())
|
||||
dataObject.nodeType = std::stoi(value["NodeType"].asString());
|
||||
if(!value["Status"].isNull())
|
||||
dataObject.status = value["Status"].asString();
|
||||
if(!value["ActiveTime"].isNull())
|
||||
dataObject.activeTime = value["ActiveTime"].asString();
|
||||
if(!value["LastOnlineTime"].isNull())
|
||||
dataObject.lastOnlineTime = value["LastOnlineTime"].asString();
|
||||
if(!value["CreateTime"].isNull())
|
||||
dataObject.createTime = value["CreateTime"].asString();
|
||||
if(!value["ChildDeviceCount"].isNull())
|
||||
dataObject.childDeviceCount = std::stol(value["ChildDeviceCount"].asString());
|
||||
if(!value["UtcActiveTime"].isNull())
|
||||
dataObject.utcActiveTime = value["UtcActiveTime"].asString();
|
||||
if(!value["UtcLastOnlineTime"].isNull())
|
||||
dataObject.utcLastOnlineTime = value["UtcLastOnlineTime"].asString();
|
||||
if(!value["UtcCreateTime"].isNull())
|
||||
dataObject.utcCreateTime = value["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_;
|
||||
}
|
||||
|
||||
60
iot/src/model/QueryDeviceGroupByDeviceRequest.cc
Normal file
60
iot/src/model/QueryDeviceGroupByDeviceRequest.cc
Normal file
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* 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/QueryDeviceGroupByDeviceRequest.h>
|
||||
|
||||
using AlibabaCloud::Iot::Model::QueryDeviceGroupByDeviceRequest;
|
||||
|
||||
QueryDeviceGroupByDeviceRequest::QueryDeviceGroupByDeviceRequest() :
|
||||
RpcServiceRequest("iot", "2018-01-20", "QueryDeviceGroupByDevice")
|
||||
{}
|
||||
|
||||
QueryDeviceGroupByDeviceRequest::~QueryDeviceGroupByDeviceRequest()
|
||||
{}
|
||||
|
||||
std::string QueryDeviceGroupByDeviceRequest::getDeviceName()const
|
||||
{
|
||||
return deviceName_;
|
||||
}
|
||||
|
||||
void QueryDeviceGroupByDeviceRequest::setDeviceName(const std::string& deviceName)
|
||||
{
|
||||
deviceName_ = deviceName;
|
||||
setParameter("DeviceName", deviceName);
|
||||
}
|
||||
|
||||
std::string QueryDeviceGroupByDeviceRequest::getProductKey()const
|
||||
{
|
||||
return productKey_;
|
||||
}
|
||||
|
||||
void QueryDeviceGroupByDeviceRequest::setProductKey(const std::string& productKey)
|
||||
{
|
||||
productKey_ = productKey;
|
||||
setParameter("ProductKey", productKey);
|
||||
}
|
||||
|
||||
std::string QueryDeviceGroupByDeviceRequest::getAccessKeyId()const
|
||||
{
|
||||
return accessKeyId_;
|
||||
}
|
||||
|
||||
void QueryDeviceGroupByDeviceRequest::setAccessKeyId(const std::string& accessKeyId)
|
||||
{
|
||||
accessKeyId_ = accessKeyId;
|
||||
setParameter("AccessKeyId", accessKeyId);
|
||||
}
|
||||
|
||||
85
iot/src/model/QueryDeviceGroupByDeviceResult.cc
Normal file
85
iot/src/model/QueryDeviceGroupByDeviceResult.cc
Normal file
@@ -0,0 +1,85 @@
|
||||
/*
|
||||
* 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/QueryDeviceGroupByDeviceResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Iot;
|
||||
using namespace AlibabaCloud::Iot::Model;
|
||||
|
||||
QueryDeviceGroupByDeviceResult::QueryDeviceGroupByDeviceResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
QueryDeviceGroupByDeviceResult::QueryDeviceGroupByDeviceResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
QueryDeviceGroupByDeviceResult::~QueryDeviceGroupByDeviceResult()
|
||||
{}
|
||||
|
||||
void QueryDeviceGroupByDeviceResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto allGroupInfos = value["GroupInfos"]["GroupInfo"];
|
||||
for (auto value : allGroupInfos)
|
||||
{
|
||||
GroupInfo groupInfosObject;
|
||||
if(!value["GroupId"].isNull())
|
||||
groupInfosObject.groupId = value["GroupId"].asString();
|
||||
if(!value["GroupName"].isNull())
|
||||
groupInfosObject.groupName = value["GroupName"].asString();
|
||||
if(!value["UtcCreate"].isNull())
|
||||
groupInfosObject.utcCreate = value["UtcCreate"].asString();
|
||||
if(!value["GroupDesc"].isNull())
|
||||
groupInfosObject.groupDesc = value["GroupDesc"].asString();
|
||||
groupInfos_.push_back(groupInfosObject);
|
||||
}
|
||||
if(!value["Success"].isNull())
|
||||
success_ = value["Success"].asString() == "true";
|
||||
if(!value["Code"].isNull())
|
||||
code_ = value["Code"].asString();
|
||||
if(!value["ErrorMessage"].isNull())
|
||||
errorMessage_ = value["ErrorMessage"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::vector<QueryDeviceGroupByDeviceResult::GroupInfo> QueryDeviceGroupByDeviceResult::getGroupInfos()const
|
||||
{
|
||||
return groupInfos_;
|
||||
}
|
||||
|
||||
std::string QueryDeviceGroupByDeviceResult::getErrorMessage()const
|
||||
{
|
||||
return errorMessage_;
|
||||
}
|
||||
|
||||
std::string QueryDeviceGroupByDeviceResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
bool QueryDeviceGroupByDeviceResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user