Iot_20180120 oldversion sdk.

This commit is contained in:
sdk-team
2022-02-08 02:54:34 +00:00
parent a09a6e094a
commit 20fb930aaf
31 changed files with 1614 additions and 14 deletions

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()
@@ -2679,6 +2679,42 @@ IotClient::CreateSceneRuleOutcomeCallable IotClient::createSceneRuleCallable(con
return task->get_future();
}
IotClient::CreateSoundCodeOutcome IotClient::createSoundCode(const CreateSoundCodeRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return CreateSoundCodeOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return CreateSoundCodeOutcome(CreateSoundCodeResult(outcome.result()));
else
return CreateSoundCodeOutcome(outcome.error());
}
void IotClient::createSoundCodeAsync(const CreateSoundCodeRequest& request, const CreateSoundCodeAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, createSoundCode(request), context);
};
asyncExecute(new Runnable(fn));
}
IotClient::CreateSoundCodeOutcomeCallable IotClient::createSoundCodeCallable(const CreateSoundCodeRequest &request) const
{
auto task = std::make_shared<std::packaged_task<CreateSoundCodeOutcome()>>(
[this, request]()
{
return this->createSoundCode(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
IotClient::CreateSpeechOutcome IotClient::createSpeech(const CreateSpeechRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -3759,6 +3795,42 @@ IotClient::DeleteSceneRuleOutcomeCallable IotClient::deleteSceneRuleCallable(con
return task->get_future();
}
IotClient::DeleteSoundCodeOutcome IotClient::deleteSoundCode(const DeleteSoundCodeRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return DeleteSoundCodeOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return DeleteSoundCodeOutcome(DeleteSoundCodeResult(outcome.result()));
else
return DeleteSoundCodeOutcome(outcome.error());
}
void IotClient::deleteSoundCodeAsync(const DeleteSoundCodeRequest& request, const DeleteSoundCodeAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, deleteSoundCode(request), context);
};
asyncExecute(new Runnable(fn));
}
IotClient::DeleteSoundCodeOutcomeCallable IotClient::deleteSoundCodeCallable(const DeleteSoundCodeRequest &request) const
{
auto task = std::make_shared<std::packaged_task<DeleteSoundCodeOutcome()>>(
[this, request]()
{
return this->deleteSoundCode(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
IotClient::DeleteSpeechOutcome IotClient::deleteSpeech(const DeleteSpeechRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -4875,6 +4947,42 @@ IotClient::GetSceneRuleOutcomeCallable IotClient::getSceneRuleCallable(const Get
return task->get_future();
}
IotClient::GetSoundCodeAudioOutcome IotClient::getSoundCodeAudio(const GetSoundCodeAudioRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return GetSoundCodeAudioOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return GetSoundCodeAudioOutcome(GetSoundCodeAudioResult(outcome.result()));
else
return GetSoundCodeAudioOutcome(outcome.error());
}
void IotClient::getSoundCodeAudioAsync(const GetSoundCodeAudioRequest& request, const GetSoundCodeAudioAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, getSoundCodeAudio(request), context);
};
asyncExecute(new Runnable(fn));
}
IotClient::GetSoundCodeAudioOutcomeCallable IotClient::getSoundCodeAudioCallable(const GetSoundCodeAudioRequest &request) const
{
auto task = std::make_shared<std::packaged_task<GetSoundCodeAudioOutcome()>>(
[this, request]()
{
return this->getSoundCodeAudio(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
IotClient::GetSpeechDeviceDetailOutcome IotClient::getSpeechDeviceDetail(const GetSpeechDeviceDetailRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -8583,6 +8691,42 @@ IotClient::QuerySolutionDeviceGroupPageOutcomeCallable IotClient::querySolutionD
return task->get_future();
}
IotClient::QuerySoundCodeListOutcome IotClient::querySoundCodeList(const QuerySoundCodeListRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return QuerySoundCodeListOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return QuerySoundCodeListOutcome(QuerySoundCodeListResult(outcome.result()));
else
return QuerySoundCodeListOutcome(outcome.error());
}
void IotClient::querySoundCodeListAsync(const QuerySoundCodeListRequest& request, const QuerySoundCodeListAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, querySoundCodeList(request), context);
};
asyncExecute(new Runnable(fn));
}
IotClient::QuerySoundCodeListOutcomeCallable IotClient::querySoundCodeListCallable(const QuerySoundCodeListRequest &request) const
{
auto task = std::make_shared<std::packaged_task<QuerySoundCodeListOutcome()>>(
[this, request]()
{
return this->querySoundCodeList(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
IotClient::QuerySpeechOutcome IotClient::querySpeech(const QuerySpeechRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -10095,6 +10239,42 @@ IotClient::SpeechBySynthesisOutcomeCallable IotClient::speechBySynthesisCallable
return task->get_future();
}
IotClient::StartAIBoxForceSyncOutcome IotClient::startAIBoxForceSync(const StartAIBoxForceSyncRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return StartAIBoxForceSyncOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return StartAIBoxForceSyncOutcome(StartAIBoxForceSyncResult(outcome.result()));
else
return StartAIBoxForceSyncOutcome(outcome.error());
}
void IotClient::startAIBoxForceSyncAsync(const StartAIBoxForceSyncRequest& request, const StartAIBoxForceSyncAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, startAIBoxForceSync(request), context);
};
asyncExecute(new Runnable(fn));
}
IotClient::StartAIBoxForceSyncOutcomeCallable IotClient::startAIBoxForceSyncCallable(const StartAIBoxForceSyncRequest &request) const
{
auto task = std::make_shared<std::packaged_task<StartAIBoxForceSyncOutcome()>>(
[this, request]()
{
return this->startAIBoxForceSync(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
IotClient::StartRuleOutcome IotClient::startRule(const StartRuleRequest &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/CreateSoundCodeRequest.h>
using AlibabaCloud::Iot::Model::CreateSoundCodeRequest;
CreateSoundCodeRequest::CreateSoundCodeRequest() :
RpcServiceRequest("iot", "2018-01-20", "CreateSoundCode")
{
setMethod(HttpRequest::Method::Post);
}
CreateSoundCodeRequest::~CreateSoundCodeRequest()
{}
int CreateSoundCodeRequest::getDuration()const
{
return duration_;
}
void CreateSoundCodeRequest::setDuration(int duration)
{
duration_ = duration;
setBodyParameter("Duration", std::to_string(duration));
}
std::string CreateSoundCodeRequest::getIotInstanceId()const
{
return iotInstanceId_;
}
void CreateSoundCodeRequest::setIotInstanceId(const std::string& iotInstanceId)
{
iotInstanceId_ = iotInstanceId;
setBodyParameter("IotInstanceId", iotInstanceId);
}
std::string CreateSoundCodeRequest::getSoundCodeContent()const
{
return soundCodeContent_;
}
void CreateSoundCodeRequest::setSoundCodeContent(const std::string& soundCodeContent)
{
soundCodeContent_ = soundCodeContent;
setBodyParameter("SoundCodeContent", soundCodeContent);
}
std::string CreateSoundCodeRequest::getApiProduct()const
{
return apiProduct_;
}
void CreateSoundCodeRequest::setApiProduct(const std::string& apiProduct)
{
apiProduct_ = apiProduct;
setBodyParameter("ApiProduct", apiProduct);
}
std::string CreateSoundCodeRequest::getApiRevision()const
{
return apiRevision_;
}
void CreateSoundCodeRequest::setApiRevision(const std::string& apiRevision)
{
apiRevision_ = apiRevision;
setBodyParameter("ApiRevision", apiRevision);
}

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/CreateSoundCodeResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Iot;
using namespace AlibabaCloud::Iot::Model;
CreateSoundCodeResult::CreateSoundCodeResult() :
ServiceResult()
{}
CreateSoundCodeResult::CreateSoundCodeResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
CreateSoundCodeResult::~CreateSoundCodeResult()
{}
void CreateSoundCodeResult::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 CreateSoundCodeResult::getData()const
{
return data_;
}
std::string CreateSoundCodeResult::getErrorMessage()const
{
return errorMessage_;
}
std::string CreateSoundCodeResult::getCode()const
{
return code_;
}
bool CreateSoundCodeResult::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/DeleteSoundCodeRequest.h>
using AlibabaCloud::Iot::Model::DeleteSoundCodeRequest;
DeleteSoundCodeRequest::DeleteSoundCodeRequest() :
RpcServiceRequest("iot", "2018-01-20", "DeleteSoundCode")
{
setMethod(HttpRequest::Method::Post);
}
DeleteSoundCodeRequest::~DeleteSoundCodeRequest()
{}
std::string DeleteSoundCodeRequest::getSoundCode()const
{
return soundCode_;
}
void DeleteSoundCodeRequest::setSoundCode(const std::string& soundCode)
{
soundCode_ = soundCode;
setBodyParameter("SoundCode", soundCode);
}
std::string DeleteSoundCodeRequest::getIotInstanceId()const
{
return iotInstanceId_;
}
void DeleteSoundCodeRequest::setIotInstanceId(const std::string& iotInstanceId)
{
iotInstanceId_ = iotInstanceId;
setBodyParameter("IotInstanceId", iotInstanceId);
}
std::string DeleteSoundCodeRequest::getApiProduct()const
{
return apiProduct_;
}
void DeleteSoundCodeRequest::setApiProduct(const std::string& apiProduct)
{
apiProduct_ = apiProduct;
setBodyParameter("ApiProduct", apiProduct);
}
std::string DeleteSoundCodeRequest::getApiRevision()const
{
return apiRevision_;
}
void DeleteSoundCodeRequest::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/DeleteSoundCodeResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Iot;
using namespace AlibabaCloud::Iot::Model;
DeleteSoundCodeResult::DeleteSoundCodeResult() :
ServiceResult()
{}
DeleteSoundCodeResult::DeleteSoundCodeResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
DeleteSoundCodeResult::~DeleteSoundCodeResult()
{}
void DeleteSoundCodeResult::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 DeleteSoundCodeResult::getErrorMessage()const
{
return errorMessage_;
}
std::string DeleteSoundCodeResult::getCode()const
{
return code_;
}
bool DeleteSoundCodeResult::getSuccess()const
{
return success_;
}

View File

@@ -0,0 +1,75 @@
/*
* 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/GetSoundCodeAudioRequest.h>
using AlibabaCloud::Iot::Model::GetSoundCodeAudioRequest;
GetSoundCodeAudioRequest::GetSoundCodeAudioRequest() :
RpcServiceRequest("iot", "2018-01-20", "GetSoundCodeAudio")
{
setMethod(HttpRequest::Method::Post);
}
GetSoundCodeAudioRequest::~GetSoundCodeAudioRequest()
{}
std::string GetSoundCodeAudioRequest::getIotInstanceId()const
{
return iotInstanceId_;
}
void GetSoundCodeAudioRequest::setIotInstanceId(const std::string& iotInstanceId)
{
iotInstanceId_ = iotInstanceId;
setBodyParameter("IotInstanceId", iotInstanceId);
}
std::vector<std::string> GetSoundCodeAudioRequest::getSoundCodeList()const
{
return soundCodeList_;
}
void GetSoundCodeAudioRequest::setSoundCodeList(const std::vector<std::string>& soundCodeList)
{
soundCodeList_ = soundCodeList;
for(int dep1 = 0; dep1!= soundCodeList.size(); dep1++) {
setBodyParameter("SoundCodeList."+ std::to_string(dep1), soundCodeList.at(dep1));
}
}
std::string GetSoundCodeAudioRequest::getApiProduct()const
{
return apiProduct_;
}
void GetSoundCodeAudioRequest::setApiProduct(const std::string& apiProduct)
{
apiProduct_ = apiProduct;
setBodyParameter("ApiProduct", apiProduct);
}
std::string GetSoundCodeAudioRequest::getApiRevision()const
{
return apiRevision_;
}
void GetSoundCodeAudioRequest::setApiRevision(const std::string& apiRevision)
{
apiRevision_ = apiRevision;
setBodyParameter("ApiRevision", apiRevision);
}

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/GetSoundCodeAudioResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Iot;
using namespace AlibabaCloud::Iot::Model;
GetSoundCodeAudioResult::GetSoundCodeAudioResult() :
ServiceResult()
{}
GetSoundCodeAudioResult::GetSoundCodeAudioResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
GetSoundCodeAudioResult::~GetSoundCodeAudioResult()
{}
void GetSoundCodeAudioResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto allData = value["Data"]["Items"];
for (const auto &item : allData)
data_.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();
}
std::vector<std::string> GetSoundCodeAudioResult::getData()const
{
return data_;
}
std::string GetSoundCodeAudioResult::getErrorMessage()const
{
return errorMessage_;
}
std::string GetSoundCodeAudioResult::getCode()const
{
return code_;
}
bool GetSoundCodeAudioResult::getSuccess()const
{
return success_;
}

View File

@@ -46,6 +46,8 @@ void InvokeDataAPIServiceResult::parse(const std::string &payload)
data_.pageSize = std::stoi(dataNode["PageSize"].asString());
if(!dataNode["ApiSrn"].isNull())
data_.apiSrn = dataNode["ApiSrn"].asString();
if(!dataNode["TotalSize"].isNull())
data_.totalSize = std::stoi(dataNode["TotalSize"].asString());
auto allFieldNameList = dataNode["FieldNameList"]["FieldNameList"];
for (auto value : allFieldNameList)
data_.fieldNameList.push_back(value.asString());

View File

@@ -71,6 +71,28 @@ void ListDeviceDistributeJobRequest::setCurrentPage(int currentPage)
setParameter("CurrentPage", std::to_string(currentPage));
}
std::string ListDeviceDistributeJobRequest::getProductKey()const
{
return productKey_;
}
void ListDeviceDistributeJobRequest::setProductKey(const std::string& productKey)
{
productKey_ = productKey;
setParameter("ProductKey", productKey);
}
std::string ListDeviceDistributeJobRequest::getJobType()const
{
return jobType_;
}
void ListDeviceDistributeJobRequest::setJobType(const std::string& jobType)
{
jobType_ = jobType;
setParameter("JobType", jobType);
}
std::string ListDeviceDistributeJobRequest::getApiProduct()const
{
return apiProduct_;

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/QuerySoundCodeListRequest.h>
using AlibabaCloud::Iot::Model::QuerySoundCodeListRequest;
QuerySoundCodeListRequest::QuerySoundCodeListRequest() :
RpcServiceRequest("iot", "2018-01-20", "QuerySoundCodeList")
{
setMethod(HttpRequest::Method::Post);
}
QuerySoundCodeListRequest::~QuerySoundCodeListRequest()
{}
int QuerySoundCodeListRequest::getPageId()const
{
return pageId_;
}
void QuerySoundCodeListRequest::setPageId(int pageId)
{
pageId_ = pageId;
setBodyParameter("PageId", std::to_string(pageId));
}
std::string QuerySoundCodeListRequest::getIotInstanceId()const
{
return iotInstanceId_;
}
void QuerySoundCodeListRequest::setIotInstanceId(const std::string& iotInstanceId)
{
iotInstanceId_ = iotInstanceId;
setBodyParameter("IotInstanceId", iotInstanceId);
}
int QuerySoundCodeListRequest::getPageSize()const
{
return pageSize_;
}
void QuerySoundCodeListRequest::setPageSize(int pageSize)
{
pageSize_ = pageSize;
setBodyParameter("PageSize", std::to_string(pageSize));
}
std::string QuerySoundCodeListRequest::getApiProduct()const
{
return apiProduct_;
}
void QuerySoundCodeListRequest::setApiProduct(const std::string& apiProduct)
{
apiProduct_ = apiProduct;
setBodyParameter("ApiProduct", apiProduct);
}
std::string QuerySoundCodeListRequest::getApiRevision()const
{
return apiRevision_;
}
void QuerySoundCodeListRequest::setApiRevision(const std::string& apiRevision)
{
apiRevision_ = apiRevision;
setBodyParameter("ApiRevision", apiRevision);
}

View File

@@ -0,0 +1,91 @@
/*
* 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/QuerySoundCodeListResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Iot;
using namespace AlibabaCloud::Iot::Model;
QuerySoundCodeListResult::QuerySoundCodeListResult() :
ServiceResult()
{}
QuerySoundCodeListResult::QuerySoundCodeListResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
QuerySoundCodeListResult::~QuerySoundCodeListResult()
{}
void QuerySoundCodeListResult::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::stoi(dataNode["Total"].asString());
if(!dataNode["PageId"].isNull())
data_.pageId = std::stoi(dataNode["PageId"].asString());
if(!dataNode["PageSize"].isNull())
data_.pageSize = std::stoi(dataNode["PageSize"].asString());
auto allListNode = dataNode["List"]["Items"];
for (auto dataNodeListItems : allListNode)
{
Data::Items itemsObject;
if(!dataNodeListItems["SoundCode"].isNull())
itemsObject.soundCode = dataNodeListItems["SoundCode"].asString();
if(!dataNodeListItems["SoundCodeContent"].isNull())
itemsObject.soundCodeContent = dataNodeListItems["SoundCodeContent"].asString();
if(!dataNodeListItems["Duration"].isNull())
itemsObject.duration = std::stoi(dataNodeListItems["Duration"].asString());
if(!dataNodeListItems["GmtCreate"].isNull())
itemsObject.gmtCreate = std::stol(dataNodeListItems["GmtCreate"].asString());
data_.list.push_back(itemsObject);
}
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();
}
QuerySoundCodeListResult::Data QuerySoundCodeListResult::getData()const
{
return data_;
}
std::string QuerySoundCodeListResult::getErrorMessage()const
{
return errorMessage_;
}
std::string QuerySoundCodeListResult::getCode()const
{
return code_;
}
bool QuerySoundCodeListResult::getSuccess()const
{
return success_;
}

View File

@@ -0,0 +1,62 @@
/*
* 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/StartAIBoxForceSyncRequest.h>
using AlibabaCloud::Iot::Model::StartAIBoxForceSyncRequest;
StartAIBoxForceSyncRequest::StartAIBoxForceSyncRequest() :
RpcServiceRequest("iot", "2018-01-20", "StartAIBoxForceSync")
{
setMethod(HttpRequest::Method::Post);
}
StartAIBoxForceSyncRequest::~StartAIBoxForceSyncRequest()
{}
std::string StartAIBoxForceSyncRequest::getIotId()const
{
return iotId_;
}
void StartAIBoxForceSyncRequest::setIotId(const std::string& iotId)
{
iotId_ = iotId;
setParameter("IotId", iotId);
}
std::string StartAIBoxForceSyncRequest::getApiProduct()const
{
return apiProduct_;
}
void StartAIBoxForceSyncRequest::setApiProduct(const std::string& apiProduct)
{
apiProduct_ = apiProduct;
setBodyParameter("ApiProduct", apiProduct);
}
std::string StartAIBoxForceSyncRequest::getApiRevision()const
{
return apiRevision_;
}
void StartAIBoxForceSyncRequest::setApiRevision(const std::string& apiRevision)
{
apiRevision_ = apiRevision;
setBodyParameter("ApiRevision", apiRevision);
}

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

View File

@@ -39,9 +39,6 @@ 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())
@@ -51,11 +48,6 @@ void SubscribeTopicResult::parse(const std::string &payload)
}
std::vector<std::string> SubscribeTopicResult::getFailureTopics()const
{
return failureTopics_;
}
std::string SubscribeTopicResult::getErrorMessage()const
{
return errorMessage_;