Add OTA API, including ReupgradeOTATask.

This commit is contained in:
sdk-team
2022-02-11 07:19:47 +00:00
parent 4bfb40e4b1
commit 99a78222f2
9 changed files with 335 additions and 4 deletions

View File

@@ -566,6 +566,8 @@
#include "model/ResetConsumerGroupPositionResult.h"
#include "model/ResetThingRequest.h"
#include "model/ResetThingResult.h"
#include "model/ReupgradeOTATaskRequest.h"
#include "model/ReupgradeOTATaskResult.h"
#include "model/SaveDevicePropRequest.h"
#include "model/SaveDevicePropResult.h"
#include "model/SetDeviceDesiredPropertyRequest.h"
@@ -1479,6 +1481,9 @@ namespace AlibabaCloud
typedef Outcome<Error, Model::ResetThingResult> ResetThingOutcome;
typedef std::future<ResetThingOutcome> ResetThingOutcomeCallable;
typedef std::function<void(const IotClient*, const Model::ResetThingRequest&, const ResetThingOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ResetThingAsyncHandler;
typedef Outcome<Error, Model::ReupgradeOTATaskResult> ReupgradeOTATaskOutcome;
typedef std::future<ReupgradeOTATaskOutcome> ReupgradeOTATaskOutcomeCallable;
typedef std::function<void(const IotClient*, const Model::ReupgradeOTATaskRequest&, const ReupgradeOTATaskOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ReupgradeOTATaskAsyncHandler;
typedef Outcome<Error, Model::SaveDevicePropResult> SaveDevicePropOutcome;
typedef std::future<SaveDevicePropOutcome> SaveDevicePropOutcomeCallable;
typedef std::function<void(const IotClient*, const Model::SaveDevicePropRequest&, const SaveDevicePropOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> SaveDevicePropAsyncHandler;
@@ -2432,6 +2437,9 @@ namespace AlibabaCloud
ResetThingOutcome resetThing(const Model::ResetThingRequest &request)const;
void resetThingAsync(const Model::ResetThingRequest& request, const ResetThingAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
ResetThingOutcomeCallable resetThingCallable(const Model::ResetThingRequest& request) const;
ReupgradeOTATaskOutcome reupgradeOTATask(const Model::ReupgradeOTATaskRequest &request)const;
void reupgradeOTATaskAsync(const Model::ReupgradeOTATaskRequest& request, const ReupgradeOTATaskAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
ReupgradeOTATaskOutcomeCallable reupgradeOTATaskCallable(const Model::ReupgradeOTATaskRequest& request) const;
SaveDevicePropOutcome saveDeviceProp(const Model::SaveDevicePropRequest &request)const;
void saveDevicePropAsync(const Model::SaveDevicePropRequest& request, const SaveDevicePropAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
SaveDevicePropOutcomeCallable saveDevicePropCallable(const Model::SaveDevicePropRequest& request) const;

View File

@@ -0,0 +1,63 @@
/*
* 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_REUPGRADEOTATASKREQUEST_H_
#define ALIBABACLOUD_IOT_MODEL_REUPGRADEOTATASKREQUEST_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 ReupgradeOTATaskRequest : public RpcServiceRequest
{
public:
ReupgradeOTATaskRequest();
~ReupgradeOTATaskRequest();
std::string getAccessKeyId()const;
void setAccessKeyId(const std::string& accessKeyId);
std::string getJobId()const;
void setJobId(const std::string& jobId);
std::string getIotInstanceId()const;
void setIotInstanceId(const std::string& iotInstanceId);
std::vector<std::string> getTaskId()const;
void setTaskId(const std::vector<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 jobId_;
std::string iotInstanceId_;
std::vector<std::string> taskId_;
std::string apiProduct_;
std::string apiRevision_;
};
}
}
}
#endif // !ALIBABACLOUD_IOT_MODEL_REUPGRADEOTATASKREQUEST_H_

View File

@@ -0,0 +1,55 @@
/*
* 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_REUPGRADEOTATASKRESULT_H_
#define ALIBABACLOUD_IOT_MODEL_REUPGRADEOTATASKRESULT_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 ReupgradeOTATaskResult : public ServiceResult
{
public:
ReupgradeOTATaskResult();
explicit ReupgradeOTATaskResult(const std::string &payload);
~ReupgradeOTATaskResult();
std::string getErrorMessage()const;
std::string getCode()const;
bool getSuccess()const;
protected:
void parse(const std::string &payload);
private:
std::string errorMessage_;
std::string code_;
bool success_;
};
}
}
}
#endif // !ALIBABACLOUD_IOT_MODEL_REUPGRADEOTATASKRESULT_H_