Iot_20180120 build sdk.

This commit is contained in:
sdk-team
2022-02-18 09:13:20 +00:00
parent 4134095a0d
commit 4b57f18912
9 changed files with 7 additions and 362 deletions

View File

@@ -1,3 +1,6 @@
2022-02-18 Version: 1.36.1059
- Iot_20180120 build sdk.
2022-02-18 Version: 1.36.1058
- Add Gis open service add data api.

View File

@@ -1 +1 @@
1.36.1058
1.36.1059

View File

@@ -283,8 +283,6 @@ set(iot_public_header_model
include/alibabacloud/iot/model/GetGatewayBySubDeviceResult.h
include/alibabacloud/iot/model/GetLoraNodesTaskRequest.h
include/alibabacloud/iot/model/GetLoraNodesTaskResult.h
include/alibabacloud/iot/model/GetNodesAddingTaskRequest.h
include/alibabacloud/iot/model/GetNodesAddingTaskResult.h
include/alibabacloud/iot/model/GetRuleRequest.h
include/alibabacloud/iot/model/GetRuleResult.h
include/alibabacloud/iot/model/GetRuleActionRequest.h
@@ -918,8 +916,6 @@ set(iot_src
src/model/GetGatewayBySubDeviceResult.cc
src/model/GetLoraNodesTaskRequest.cc
src/model/GetLoraNodesTaskResult.cc
src/model/GetNodesAddingTaskRequest.cc
src/model/GetNodesAddingTaskResult.cc
src/model/GetRuleRequest.cc
src/model/GetRuleResult.cc
src/model/GetRuleActionRequest.cc

View File

@@ -284,8 +284,6 @@
#include "model/GetGatewayBySubDeviceResult.h"
#include "model/GetLoraNodesTaskRequest.h"
#include "model/GetLoraNodesTaskResult.h"
#include "model/GetNodesAddingTaskRequest.h"
#include "model/GetNodesAddingTaskResult.h"
#include "model/GetRuleRequest.h"
#include "model/GetRuleResult.h"
#include "model/GetRuleActionRequest.h"
@@ -1056,9 +1054,6 @@ namespace AlibabaCloud
typedef Outcome<Error, Model::GetLoraNodesTaskResult> GetLoraNodesTaskOutcome;
typedef std::future<GetLoraNodesTaskOutcome> GetLoraNodesTaskOutcomeCallable;
typedef std::function<void(const IotClient*, const Model::GetLoraNodesTaskRequest&, const GetLoraNodesTaskOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetLoraNodesTaskAsyncHandler;
typedef Outcome<Error, Model::GetNodesAddingTaskResult> GetNodesAddingTaskOutcome;
typedef std::future<GetNodesAddingTaskOutcome> GetNodesAddingTaskOutcomeCallable;
typedef std::function<void(const IotClient*, const Model::GetNodesAddingTaskRequest&, const GetNodesAddingTaskOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetNodesAddingTaskAsyncHandler;
typedef Outcome<Error, Model::GetRuleResult> GetRuleOutcome;
typedef std::future<GetRuleOutcome> GetRuleOutcomeCallable;
typedef std::function<void(const IotClient*, const Model::GetRuleRequest&, const GetRuleOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetRuleAsyncHandler;
@@ -2009,9 +2004,6 @@ namespace AlibabaCloud
GetLoraNodesTaskOutcome getLoraNodesTask(const Model::GetLoraNodesTaskRequest &request)const;
void getLoraNodesTaskAsync(const Model::GetLoraNodesTaskRequest& request, const GetLoraNodesTaskAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
GetLoraNodesTaskOutcomeCallable getLoraNodesTaskCallable(const Model::GetLoraNodesTaskRequest& request) const;
GetNodesAddingTaskOutcome getNodesAddingTask(const Model::GetNodesAddingTaskRequest &request)const;
void getNodesAddingTaskAsync(const Model::GetNodesAddingTaskRequest& request, const GetNodesAddingTaskAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
GetNodesAddingTaskOutcomeCallable getNodesAddingTaskCallable(const Model::GetNodesAddingTaskRequest& request) const;
GetRuleOutcome getRule(const Model::GetRuleRequest &request)const;
void getRuleAsync(const Model::GetRuleRequest& request, const GetRuleAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
GetRuleOutcomeCallable getRuleCallable(const Model::GetRuleRequest& request) const;

View File

@@ -1,60 +0,0 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ALIBABACLOUD_IOT_MODEL_GETNODESADDINGTASKREQUEST_H_
#define ALIBABACLOUD_IOT_MODEL_GETNODESADDINGTASKREQUEST_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 GetNodesAddingTaskRequest : public RpcServiceRequest
{
public:
GetNodesAddingTaskRequest();
~GetNodesAddingTaskRequest();
std::string getAccessKeyId()const;
void setAccessKeyId(const std::string& accessKeyId);
std::string getIotInstanceId()const;
void setIotInstanceId(const std::string& iotInstanceId);
std::string getTaskId()const;
void setTaskId(const std::string& taskId);
std::string getApiProduct()const;
void setApiProduct(const std::string& apiProduct);
std::string getApiRevision()const;
void setApiRevision(const std::string& apiRevision);
private:
std::string accessKeyId_;
std::string iotInstanceId_;
std::string taskId_;
std::string apiProduct_;
std::string apiRevision_;
};
}
}
}
#endif // !ALIBABACLOUD_IOT_MODEL_GETNODESADDINGTASKREQUEST_H_

View File

@@ -1,65 +0,0 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ALIBABACLOUD_IOT_MODEL_GETNODESADDINGTASKRESULT_H_
#define ALIBABACLOUD_IOT_MODEL_GETNODESADDINGTASKRESULT_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 GetNodesAddingTaskResult : public ServiceResult
{
public:
GetNodesAddingTaskResult();
explicit GetNodesAddingTaskResult(const std::string &payload);
~GetNodesAddingTaskResult();
std::vector<std::string> getSuccessDevEuis()const;
long getTotalCount()const;
std::string getTaskId()const;
std::string getErrorMessage()const;
long getSuccessCount()const;
std::string getCode()const;
std::string getTaskState()const;
bool getSuccess()const;
protected:
void parse(const std::string &payload);
private:
std::vector<std::string> successDevEuis_;
long totalCount_;
std::string taskId_;
std::string errorMessage_;
long successCount_;
std::string code_;
std::string taskState_;
bool success_;
};
}
}
}
#endif // !ALIBABACLOUD_IOT_MODEL_GETNODESADDINGTASKRESULT_H_

View File

@@ -31,21 +31,21 @@ IotClient::IotClient(const Credentials &credentials, const ClientConfiguration &
RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(credentials), configuration)
{
auto locationClient = std::make_shared<LocationClient>(credentials, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "iot");
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
}
IotClient::IotClient(const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) :
RpcServiceClient(SERVICE_NAME, credentialsProvider, configuration)
{
auto locationClient = std::make_shared<LocationClient>(credentialsProvider, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "iot");
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
}
IotClient::IotClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) :
RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(accessKeyId, accessKeySecret), configuration)
{
auto locationClient = std::make_shared<LocationClient>(accessKeyId, accessKeySecret, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "iot");
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
}
IotClient::~IotClient()
@@ -4767,42 +4767,6 @@ IotClient::GetLoraNodesTaskOutcomeCallable IotClient::getLoraNodesTaskCallable(c
return task->get_future();
}
IotClient::GetNodesAddingTaskOutcome IotClient::getNodesAddingTask(const GetNodesAddingTaskRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return GetNodesAddingTaskOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return GetNodesAddingTaskOutcome(GetNodesAddingTaskResult(outcome.result()));
else
return GetNodesAddingTaskOutcome(outcome.error());
}
void IotClient::getNodesAddingTaskAsync(const GetNodesAddingTaskRequest& request, const GetNodesAddingTaskAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, getNodesAddingTask(request), context);
};
asyncExecute(new Runnable(fn));
}
IotClient::GetNodesAddingTaskOutcomeCallable IotClient::getNodesAddingTaskCallable(const GetNodesAddingTaskRequest &request) const
{
auto task = std::make_shared<std::packaged_task<GetNodesAddingTaskOutcome()>>(
[this, request]()
{
return this->getNodesAddingTask(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
IotClient::GetRuleOutcome IotClient::getRule(const GetRuleRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();

View File

@@ -1,84 +0,0 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <alibabacloud/iot/model/GetNodesAddingTaskRequest.h>
using AlibabaCloud::Iot::Model::GetNodesAddingTaskRequest;
GetNodesAddingTaskRequest::GetNodesAddingTaskRequest() :
RpcServiceRequest("iot", "2018-01-20", "GetNodesAddingTask")
{
setMethod(HttpRequest::Method::Post);
}
GetNodesAddingTaskRequest::~GetNodesAddingTaskRequest()
{}
std::string GetNodesAddingTaskRequest::getAccessKeyId()const
{
return accessKeyId_;
}
void GetNodesAddingTaskRequest::setAccessKeyId(const std::string& accessKeyId)
{
accessKeyId_ = accessKeyId;
setParameter("AccessKeyId", accessKeyId);
}
std::string GetNodesAddingTaskRequest::getIotInstanceId()const
{
return iotInstanceId_;
}
void GetNodesAddingTaskRequest::setIotInstanceId(const std::string& iotInstanceId)
{
iotInstanceId_ = iotInstanceId;
setParameter("IotInstanceId", iotInstanceId);
}
std::string GetNodesAddingTaskRequest::getTaskId()const
{
return taskId_;
}
void GetNodesAddingTaskRequest::setTaskId(const std::string& taskId)
{
taskId_ = taskId;
setParameter("TaskId", taskId);
}
std::string GetNodesAddingTaskRequest::getApiProduct()const
{
return apiProduct_;
}
void GetNodesAddingTaskRequest::setApiProduct(const std::string& apiProduct)
{
apiProduct_ = apiProduct;
setBodyParameter("ApiProduct", apiProduct);
}
std::string GetNodesAddingTaskRequest::getApiRevision()const
{
return apiRevision_;
}
void GetNodesAddingTaskRequest::setApiRevision(const std::string& apiRevision)
{
apiRevision_ = apiRevision;
setBodyParameter("ApiRevision", apiRevision);
}

View File

@@ -1,101 +0,0 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <alibabacloud/iot/model/GetNodesAddingTaskResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Iot;
using namespace AlibabaCloud::Iot::Model;
GetNodesAddingTaskResult::GetNodesAddingTaskResult() :
ServiceResult()
{}
GetNodesAddingTaskResult::GetNodesAddingTaskResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
GetNodesAddingTaskResult::~GetNodesAddingTaskResult()
{}
void GetNodesAddingTaskResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto allSuccessDevEuis = value["SuccessDevEuis"]["SuccessDevEui"];
for (const auto &item : allSuccessDevEuis)
successDevEuis_.push_back(item.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["TaskId"].isNull())
taskId_ = value["TaskId"].asString();
if(!value["TaskState"].isNull())
taskState_ = value["TaskState"].asString();
if(!value["TotalCount"].isNull())
totalCount_ = std::stol(value["TotalCount"].asString());
if(!value["SuccessCount"].isNull())
successCount_ = std::stol(value["SuccessCount"].asString());
}
std::vector<std::string> GetNodesAddingTaskResult::getSuccessDevEuis()const
{
return successDevEuis_;
}
long GetNodesAddingTaskResult::getTotalCount()const
{
return totalCount_;
}
std::string GetNodesAddingTaskResult::getTaskId()const
{
return taskId_;
}
std::string GetNodesAddingTaskResult::getErrorMessage()const
{
return errorMessage_;
}
long GetNodesAddingTaskResult::getSuccessCount()const
{
return successCount_;
}
std::string GetNodesAddingTaskResult::getCode()const
{
return code_;
}
std::string GetNodesAddingTaskResult::getTaskState()const
{
return taskState_;
}
bool GetNodesAddingTaskResult::getSuccess()const
{
return success_;
}