ClearDeviceDesiredProperty open Api.

This commit is contained in:
sdk-team
2023-01-13 03:58:52 +00:00
parent e174ddcab8
commit cf26b726ed
20 changed files with 528 additions and 9 deletions

View File

@@ -1887,6 +1887,42 @@ IotClient::CheckBindLicenseDeviceProgressOutcomeCallable IotClient::checkBindLic
return task->get_future();
}
IotClient::ClearDeviceDesiredPropertyOutcome IotClient::clearDeviceDesiredProperty(const ClearDeviceDesiredPropertyRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return ClearDeviceDesiredPropertyOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return ClearDeviceDesiredPropertyOutcome(ClearDeviceDesiredPropertyResult(outcome.result()));
else
return ClearDeviceDesiredPropertyOutcome(outcome.error());
}
void IotClient::clearDeviceDesiredPropertyAsync(const ClearDeviceDesiredPropertyRequest& request, const ClearDeviceDesiredPropertyAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, clearDeviceDesiredProperty(request), context);
};
asyncExecute(new Runnable(fn));
}
IotClient::ClearDeviceDesiredPropertyOutcomeCallable IotClient::clearDeviceDesiredPropertyCallable(const ClearDeviceDesiredPropertyRequest &request) const
{
auto task = std::make_shared<std::packaged_task<ClearDeviceDesiredPropertyOutcome()>>(
[this, request]()
{
return this->clearDeviceDesiredProperty(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
IotClient::ClearEdgeInstanceDriverConfigsOutcome IotClient::clearEdgeInstanceDriverConfigs(const ClearEdgeInstanceDriverConfigsRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();

View File

@@ -0,0 +1,141 @@
/*
* 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/ClearDeviceDesiredPropertyRequest.h>
using AlibabaCloud::Iot::Model::ClearDeviceDesiredPropertyRequest;
ClearDeviceDesiredPropertyRequest::ClearDeviceDesiredPropertyRequest() :
RpcServiceRequest("iot", "2018-01-20", "ClearDeviceDesiredProperty")
{
setMethod(HttpRequest::Method::Post);
}
ClearDeviceDesiredPropertyRequest::~ClearDeviceDesiredPropertyRequest()
{}
std::string ClearDeviceDesiredPropertyRequest::getRealTenantId()const
{
return realTenantId_;
}
void ClearDeviceDesiredPropertyRequest::setRealTenantId(const std::string& realTenantId)
{
realTenantId_ = realTenantId;
setParameter("RealTenantId", realTenantId);
}
std::string ClearDeviceDesiredPropertyRequest::getAccessKeyId()const
{
return accessKeyId_;
}
void ClearDeviceDesiredPropertyRequest::setAccessKeyId(const std::string& accessKeyId)
{
accessKeyId_ = accessKeyId;
setParameter("AccessKeyId", accessKeyId);
}
std::string ClearDeviceDesiredPropertyRequest::getRealTripartiteKey()const
{
return realTripartiteKey_;
}
void ClearDeviceDesiredPropertyRequest::setRealTripartiteKey(const std::string& realTripartiteKey)
{
realTripartiteKey_ = realTripartiteKey;
setParameter("RealTripartiteKey", realTripartiteKey);
}
std::string ClearDeviceDesiredPropertyRequest::getIotId()const
{
return iotId_;
}
void ClearDeviceDesiredPropertyRequest::setIotId(const std::string& iotId)
{
iotId_ = iotId;
setParameter("IotId", iotId);
}
std::string ClearDeviceDesiredPropertyRequest::getIotInstanceId()const
{
return iotInstanceId_;
}
void ClearDeviceDesiredPropertyRequest::setIotInstanceId(const std::string& iotInstanceId)
{
iotInstanceId_ = iotInstanceId;
setParameter("IotInstanceId", iotInstanceId);
}
std::vector<std::string> ClearDeviceDesiredPropertyRequest::getIdentifies()const
{
return identifies_;
}
void ClearDeviceDesiredPropertyRequest::setIdentifies(const std::vector<std::string>& identifies)
{
identifies_ = identifies;
for(int dep1 = 0; dep1!= identifies.size(); dep1++) {
setBodyParameter("Identifies."+ std::to_string(dep1), identifies.at(dep1));
}
}
std::string ClearDeviceDesiredPropertyRequest::getProductKey()const
{
return productKey_;
}
void ClearDeviceDesiredPropertyRequest::setProductKey(const std::string& productKey)
{
productKey_ = productKey;
setParameter("ProductKey", productKey);
}
std::string ClearDeviceDesiredPropertyRequest::getApiProduct()const
{
return apiProduct_;
}
void ClearDeviceDesiredPropertyRequest::setApiProduct(const std::string& apiProduct)
{
apiProduct_ = apiProduct;
setBodyParameter("ApiProduct", apiProduct);
}
std::string ClearDeviceDesiredPropertyRequest::getApiRevision()const
{
return apiRevision_;
}
void ClearDeviceDesiredPropertyRequest::setApiRevision(const std::string& apiRevision)
{
apiRevision_ = apiRevision;
setBodyParameter("ApiRevision", apiRevision);
}
std::string ClearDeviceDesiredPropertyRequest::getDeviceName()const
{
return deviceName_;
}
void ClearDeviceDesiredPropertyRequest::setDeviceName(const std::string& deviceName)
{
deviceName_ = deviceName;
setParameter("DeviceName", deviceName);
}

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/ClearDeviceDesiredPropertyResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Iot;
using namespace AlibabaCloud::Iot::Model;
ClearDeviceDesiredPropertyResult::ClearDeviceDesiredPropertyResult() :
ServiceResult()
{}
ClearDeviceDesiredPropertyResult::ClearDeviceDesiredPropertyResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
ClearDeviceDesiredPropertyResult::~ClearDeviceDesiredPropertyResult()
{}
void ClearDeviceDesiredPropertyResult::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["Versions"].isNull())
data_.versions = dataNode["Versions"].asString();
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();
}
ClearDeviceDesiredPropertyResult::Data ClearDeviceDesiredPropertyResult::getData()const
{
return data_;
}
std::string ClearDeviceDesiredPropertyResult::getErrorMessage()const
{
return errorMessage_;
}
std::string ClearDeviceDesiredPropertyResult::getCode()const
{
return code_;
}
bool ClearDeviceDesiredPropertyResult::getSuccess()const
{
return success_;
}

View File

@@ -194,6 +194,17 @@ void CreateSubscribeRelationRequest::setOtaJobFlag(bool otaJobFlag)
setParameter("OtaJobFlag", otaJobFlag ? "true" : "false");
}
std::string CreateSubscribeRelationRequest::getSubscribeFlags()const
{
return subscribeFlags_;
}
void CreateSubscribeRelationRequest::setSubscribeFlags(const std::string& subscribeFlags)
{
subscribeFlags_ = subscribeFlags;
setParameter("SubscribeFlags", subscribeFlags);
}
std::string CreateSubscribeRelationRequest::getApiProduct()const
{
return apiProduct_;

View File

@@ -27,6 +27,28 @@ CreateThingScriptRequest::CreateThingScriptRequest() :
CreateThingScriptRequest::~CreateThingScriptRequest()
{}
std::string CreateThingScriptRequest::getRealTenantId()const
{
return realTenantId_;
}
void CreateThingScriptRequest::setRealTenantId(const std::string& realTenantId)
{
realTenantId_ = realTenantId;
setParameter("RealTenantId", realTenantId);
}
std::string CreateThingScriptRequest::getRealTripartiteKey()const
{
return realTripartiteKey_;
}
void CreateThingScriptRequest::setRealTripartiteKey(const std::string& realTripartiteKey)
{
realTripartiteKey_ = realTripartiteKey;
setParameter("RealTripartiteKey", realTripartiteKey);
}
std::string CreateThingScriptRequest::getIotInstanceId()const
{
return iotInstanceId_;

View File

@@ -27,15 +27,26 @@ GetThingScriptRequest::GetThingScriptRequest() :
GetThingScriptRequest::~GetThingScriptRequest()
{}
std::string GetThingScriptRequest::getProductKey()const
std::string GetThingScriptRequest::getRealTenantId()const
{
return productKey_;
return realTenantId_;
}
void GetThingScriptRequest::setProductKey(const std::string& productKey)
void GetThingScriptRequest::setRealTenantId(const std::string& realTenantId)
{
productKey_ = productKey;
setParameter("ProductKey", productKey);
realTenantId_ = realTenantId;
setParameter("RealTenantId", realTenantId);
}
std::string GetThingScriptRequest::getRealTripartiteKey()const
{
return realTripartiteKey_;
}
void GetThingScriptRequest::setRealTripartiteKey(const std::string& realTripartiteKey)
{
realTripartiteKey_ = realTripartiteKey;
setParameter("RealTripartiteKey", realTripartiteKey);
}
std::string GetThingScriptRequest::getIotInstanceId()const
@@ -49,6 +60,17 @@ void GetThingScriptRequest::setIotInstanceId(const std::string& iotInstanceId)
setParameter("IotInstanceId", iotInstanceId);
}
std::string GetThingScriptRequest::getProductKey()const
{
return productKey_;
}
void GetThingScriptRequest::setProductKey(const std::string& productKey)
{
productKey_ = productKey;
setParameter("ProductKey", productKey);
}
std::string GetThingScriptRequest::getApiProduct()const
{
return apiProduct_;

View File

@@ -74,6 +74,8 @@ void QuerySubscribeRelationResult::parse(const std::string &payload)
otaVersionFlag_ = value["OtaVersionFlag"].asString() == "true";
if(!value["OtaJobFlag"].isNull())
otaJobFlag_ = value["OtaJobFlag"].asString() == "true";
if(!value["SubscribeFlags"].isNull())
subscribeFlags_ = value["SubscribeFlags"].asString();
}
@@ -122,6 +124,11 @@ bool QuerySubscribeRelationResult::getThingHistoryFlag()const
return thingHistoryFlag_;
}
std::string QuerySubscribeRelationResult::getSubscribeFlags()const
{
return subscribeFlags_;
}
std::string QuerySubscribeRelationResult::getType()const
{
return type_;

View File

@@ -172,6 +172,17 @@ void UpdateSubscribeRelationRequest::setOtaJobFlag(bool otaJobFlag)
setParameter("OtaJobFlag", otaJobFlag ? "true" : "false");
}
std::string UpdateSubscribeRelationRequest::getSubscribeFlags()const
{
return subscribeFlags_;
}
void UpdateSubscribeRelationRequest::setSubscribeFlags(const std::string& subscribeFlags)
{
subscribeFlags_ = subscribeFlags;
setParameter("SubscribeFlags", subscribeFlags);
}
std::string UpdateSubscribeRelationRequest::getApiProduct()const
{
return apiProduct_;

View File

@@ -27,6 +27,28 @@ UpdateThingScriptRequest::UpdateThingScriptRequest() :
UpdateThingScriptRequest::~UpdateThingScriptRequest()
{}
std::string UpdateThingScriptRequest::getRealTenantId()const
{
return realTenantId_;
}
void UpdateThingScriptRequest::setRealTenantId(const std::string& realTenantId)
{
realTenantId_ = realTenantId;
setParameter("RealTenantId", realTenantId);
}
std::string UpdateThingScriptRequest::getRealTripartiteKey()const
{
return realTripartiteKey_;
}
void UpdateThingScriptRequest::setRealTripartiteKey(const std::string& realTripartiteKey)
{
realTripartiteKey_ = realTripartiteKey;
setParameter("RealTripartiteKey", realTripartiteKey);
}
std::string UpdateThingScriptRequest::getIotInstanceId()const
{
return iotInstanceId_;