From 51a7c5171c3acdb93bed59b2551222d3f1386851 Mon Sep 17 00:00:00 2001 From: sdk-team Date: Fri, 25 Mar 2022 02:41:56 +0000 Subject: [PATCH] Iot_20180120 old version sdk. --- CHANGELOG | 3 + VERSION | 2 +- iot/CMakeLists.txt | 8 +++ iot/include/alibabacloud/iot/IotClient.h | 16 +++++ .../iot/model/RecognizeCarNumRequest.h | 54 ++++++++++++++ .../iot/model/RecognizeCarNumResult.h | 57 +++++++++++++++ .../model/RecognizePictureGeneralRequest.h | 54 ++++++++++++++ .../iot/model/RecognizePictureGeneralResult.h | 57 +++++++++++++++ iot/src/IotClient.cc | 72 +++++++++++++++++++ iot/src/model/RecognizeCarNumRequest.cc | 62 ++++++++++++++++ iot/src/model/RecognizeCarNumResult.cc | 72 +++++++++++++++++++ .../model/RecognizePictureGeneralRequest.cc | 62 ++++++++++++++++ .../model/RecognizePictureGeneralResult.cc | 72 +++++++++++++++++++ 13 files changed, 590 insertions(+), 1 deletion(-) create mode 100644 iot/include/alibabacloud/iot/model/RecognizeCarNumRequest.h create mode 100644 iot/include/alibabacloud/iot/model/RecognizeCarNumResult.h create mode 100644 iot/include/alibabacloud/iot/model/RecognizePictureGeneralRequest.h create mode 100644 iot/include/alibabacloud/iot/model/RecognizePictureGeneralResult.h create mode 100644 iot/src/model/RecognizeCarNumRequest.cc create mode 100644 iot/src/model/RecognizeCarNumResult.cc create mode 100644 iot/src/model/RecognizePictureGeneralRequest.cc create mode 100644 iot/src/model/RecognizePictureGeneralResult.cc diff --git a/CHANGELOG b/CHANGELOG index 834dd25d2..01337a408 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2022-03-25 Version: 1.36.1090 +- Iot_20180120 old version sdk. + 2022-03-24 Version: 1.36.1089 - Supported CreateLakeHouseSpace,AddLhMembers,DeleteLhMembers,ListLhTaskFlowAndScenario,ChangeLhDagOwner,ReDeployLhDagVersion API. diff --git a/VERSION b/VERSION index 71138f9db..f4366665c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.1089 \ No newline at end of file +1.36.1090 \ No newline at end of file diff --git a/iot/CMakeLists.txt b/iot/CMakeLists.txt index 9b658e131..5915d2a18 100644 --- a/iot/CMakeLists.txt +++ b/iot/CMakeLists.txt @@ -543,6 +543,10 @@ set(iot_public_header_model include/alibabacloud/iot/model/QueryTopicRouteTableResult.h include/alibabacloud/iot/model/RRpcRequest.h include/alibabacloud/iot/model/RRpcResult.h + include/alibabacloud/iot/model/RecognizeCarNumRequest.h + include/alibabacloud/iot/model/RecognizeCarNumResult.h + include/alibabacloud/iot/model/RecognizePictureGeneralRequest.h + include/alibabacloud/iot/model/RecognizePictureGeneralResult.h include/alibabacloud/iot/model/RefreshDeviceTunnelSharePasswordRequest.h include/alibabacloud/iot/model/RefreshDeviceTunnelSharePasswordResult.h include/alibabacloud/iot/model/RefreshStudioAppTokenOpenRequest.h @@ -1174,6 +1178,10 @@ set(iot_src src/model/QueryTopicRouteTableResult.cc src/model/RRpcRequest.cc src/model/RRpcResult.cc + src/model/RecognizeCarNumRequest.cc + src/model/RecognizeCarNumResult.cc + src/model/RecognizePictureGeneralRequest.cc + src/model/RecognizePictureGeneralResult.cc src/model/RefreshDeviceTunnelSharePasswordRequest.cc src/model/RefreshDeviceTunnelSharePasswordResult.cc src/model/RefreshStudioAppTokenOpenRequest.cc diff --git a/iot/include/alibabacloud/iot/IotClient.h b/iot/include/alibabacloud/iot/IotClient.h index b7a2f2d62..589a74ef7 100644 --- a/iot/include/alibabacloud/iot/IotClient.h +++ b/iot/include/alibabacloud/iot/IotClient.h @@ -544,6 +544,10 @@ #include "model/QueryTopicRouteTableResult.h" #include "model/RRpcRequest.h" #include "model/RRpcResult.h" +#include "model/RecognizeCarNumRequest.h" +#include "model/RecognizeCarNumResult.h" +#include "model/RecognizePictureGeneralRequest.h" +#include "model/RecognizePictureGeneralResult.h" #include "model/RefreshDeviceTunnelSharePasswordRequest.h" #include "model/RefreshDeviceTunnelSharePasswordResult.h" #include "model/RefreshStudioAppTokenOpenRequest.h" @@ -1442,6 +1446,12 @@ namespace AlibabaCloud typedef Outcome RRpcOutcome; typedef std::future RRpcOutcomeCallable; typedef std::function&)> RRpcAsyncHandler; + typedef Outcome RecognizeCarNumOutcome; + typedef std::future RecognizeCarNumOutcomeCallable; + typedef std::function&)> RecognizeCarNumAsyncHandler; + typedef Outcome RecognizePictureGeneralOutcome; + typedef std::future RecognizePictureGeneralOutcomeCallable; + typedef std::function&)> RecognizePictureGeneralAsyncHandler; typedef Outcome RefreshDeviceTunnelSharePasswordOutcome; typedef std::future RefreshDeviceTunnelSharePasswordOutcomeCallable; typedef std::function&)> RefreshDeviceTunnelSharePasswordAsyncHandler; @@ -2389,6 +2399,12 @@ namespace AlibabaCloud RRpcOutcome rRpc(const Model::RRpcRequest &request)const; void rRpcAsync(const Model::RRpcRequest& request, const RRpcAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; RRpcOutcomeCallable rRpcCallable(const Model::RRpcRequest& request) const; + RecognizeCarNumOutcome recognizeCarNum(const Model::RecognizeCarNumRequest &request)const; + void recognizeCarNumAsync(const Model::RecognizeCarNumRequest& request, const RecognizeCarNumAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + RecognizeCarNumOutcomeCallable recognizeCarNumCallable(const Model::RecognizeCarNumRequest& request) const; + RecognizePictureGeneralOutcome recognizePictureGeneral(const Model::RecognizePictureGeneralRequest &request)const; + void recognizePictureGeneralAsync(const Model::RecognizePictureGeneralRequest& request, const RecognizePictureGeneralAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + RecognizePictureGeneralOutcomeCallable recognizePictureGeneralCallable(const Model::RecognizePictureGeneralRequest& request) const; RefreshDeviceTunnelSharePasswordOutcome refreshDeviceTunnelSharePassword(const Model::RefreshDeviceTunnelSharePasswordRequest &request)const; void refreshDeviceTunnelSharePasswordAsync(const Model::RefreshDeviceTunnelSharePasswordRequest& request, const RefreshDeviceTunnelSharePasswordAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; RefreshDeviceTunnelSharePasswordOutcomeCallable refreshDeviceTunnelSharePasswordCallable(const Model::RefreshDeviceTunnelSharePasswordRequest& request) const; diff --git a/iot/include/alibabacloud/iot/model/RecognizeCarNumRequest.h b/iot/include/alibabacloud/iot/model/RecognizeCarNumRequest.h new file mode 100644 index 000000000..c4017500c --- /dev/null +++ b/iot/include/alibabacloud/iot/model/RecognizeCarNumRequest.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_RECOGNIZECARNUMREQUEST_H_ +#define ALIBABACLOUD_IOT_MODEL_RECOGNIZECARNUMREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Iot + { + namespace Model + { + class ALIBABACLOUD_IOT_EXPORT RecognizeCarNumRequest : public RpcServiceRequest + { + + public: + RecognizeCarNumRequest(); + ~RecognizeCarNumRequest(); + + std::string getUrl()const; + void setUrl(const std::string& url); + std::string getApiProduct()const; + void setApiProduct(const std::string& apiProduct); + std::string getApiRevision()const; + void setApiRevision(const std::string& apiRevision); + + private: + std::string url_; + std::string apiProduct_; + std::string apiRevision_; + + }; + } + } +} +#endif // !ALIBABACLOUD_IOT_MODEL_RECOGNIZECARNUMREQUEST_H_ \ No newline at end of file diff --git a/iot/include/alibabacloud/iot/model/RecognizeCarNumResult.h b/iot/include/alibabacloud/iot/model/RecognizeCarNumResult.h new file mode 100644 index 000000000..d92831822 --- /dev/null +++ b/iot/include/alibabacloud/iot/model/RecognizeCarNumResult.h @@ -0,0 +1,57 @@ +/* + * 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_RECOGNIZECARNUMRESULT_H_ +#define ALIBABACLOUD_IOT_MODEL_RECOGNIZECARNUMRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Iot + { + namespace Model + { + class ALIBABACLOUD_IOT_EXPORT RecognizeCarNumResult : public ServiceResult + { + public: + + + RecognizeCarNumResult(); + explicit RecognizeCarNumResult(const std::string &payload); + ~RecognizeCarNumResult(); + std::string getData()const; + std::string getErrorMessage()const; + std::string getCode()const; + bool getSuccess()const; + + protected: + void parse(const std::string &payload); + private: + std::string data_; + std::string errorMessage_; + std::string code_; + bool success_; + + }; + } + } +} +#endif // !ALIBABACLOUD_IOT_MODEL_RECOGNIZECARNUMRESULT_H_ \ No newline at end of file diff --git a/iot/include/alibabacloud/iot/model/RecognizePictureGeneralRequest.h b/iot/include/alibabacloud/iot/model/RecognizePictureGeneralRequest.h new file mode 100644 index 000000000..cdedf3bcf --- /dev/null +++ b/iot/include/alibabacloud/iot/model/RecognizePictureGeneralRequest.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_RECOGNIZEPICTUREGENERALREQUEST_H_ +#define ALIBABACLOUD_IOT_MODEL_RECOGNIZEPICTUREGENERALREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Iot + { + namespace Model + { + class ALIBABACLOUD_IOT_EXPORT RecognizePictureGeneralRequest : public RpcServiceRequest + { + + public: + RecognizePictureGeneralRequest(); + ~RecognizePictureGeneralRequest(); + + std::string getUrl()const; + void setUrl(const std::string& url); + std::string getApiProduct()const; + void setApiProduct(const std::string& apiProduct); + std::string getApiRevision()const; + void setApiRevision(const std::string& apiRevision); + + private: + std::string url_; + std::string apiProduct_; + std::string apiRevision_; + + }; + } + } +} +#endif // !ALIBABACLOUD_IOT_MODEL_RECOGNIZEPICTUREGENERALREQUEST_H_ \ No newline at end of file diff --git a/iot/include/alibabacloud/iot/model/RecognizePictureGeneralResult.h b/iot/include/alibabacloud/iot/model/RecognizePictureGeneralResult.h new file mode 100644 index 000000000..10a063e29 --- /dev/null +++ b/iot/include/alibabacloud/iot/model/RecognizePictureGeneralResult.h @@ -0,0 +1,57 @@ +/* + * 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_RECOGNIZEPICTUREGENERALRESULT_H_ +#define ALIBABACLOUD_IOT_MODEL_RECOGNIZEPICTUREGENERALRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Iot + { + namespace Model + { + class ALIBABACLOUD_IOT_EXPORT RecognizePictureGeneralResult : public ServiceResult + { + public: + + + RecognizePictureGeneralResult(); + explicit RecognizePictureGeneralResult(const std::string &payload); + ~RecognizePictureGeneralResult(); + std::string getData()const; + std::string getErrorMessage()const; + std::string getCode()const; + bool getSuccess()const; + + protected: + void parse(const std::string &payload); + private: + std::string data_; + std::string errorMessage_; + std::string code_; + bool success_; + + }; + } + } +} +#endif // !ALIBABACLOUD_IOT_MODEL_RECOGNIZEPICTUREGENERALRESULT_H_ \ No newline at end of file diff --git a/iot/src/IotClient.cc b/iot/src/IotClient.cc index 3870c932e..579c15db0 100644 --- a/iot/src/IotClient.cc +++ b/iot/src/IotClient.cc @@ -9447,6 +9447,78 @@ IotClient::RRpcOutcomeCallable IotClient::rRpcCallable(const RRpcRequest &reques return task->get_future(); } +IotClient::RecognizeCarNumOutcome IotClient::recognizeCarNum(const RecognizeCarNumRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return RecognizeCarNumOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return RecognizeCarNumOutcome(RecognizeCarNumResult(outcome.result())); + else + return RecognizeCarNumOutcome(outcome.error()); +} + +void IotClient::recognizeCarNumAsync(const RecognizeCarNumRequest& request, const RecognizeCarNumAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, recognizeCarNum(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +IotClient::RecognizeCarNumOutcomeCallable IotClient::recognizeCarNumCallable(const RecognizeCarNumRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->recognizeCarNum(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +IotClient::RecognizePictureGeneralOutcome IotClient::recognizePictureGeneral(const RecognizePictureGeneralRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return RecognizePictureGeneralOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return RecognizePictureGeneralOutcome(RecognizePictureGeneralResult(outcome.result())); + else + return RecognizePictureGeneralOutcome(outcome.error()); +} + +void IotClient::recognizePictureGeneralAsync(const RecognizePictureGeneralRequest& request, const RecognizePictureGeneralAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, recognizePictureGeneral(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +IotClient::RecognizePictureGeneralOutcomeCallable IotClient::recognizePictureGeneralCallable(const RecognizePictureGeneralRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->recognizePictureGeneral(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + IotClient::RefreshDeviceTunnelSharePasswordOutcome IotClient::refreshDeviceTunnelSharePassword(const RefreshDeviceTunnelSharePasswordRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); diff --git a/iot/src/model/RecognizeCarNumRequest.cc b/iot/src/model/RecognizeCarNumRequest.cc new file mode 100644 index 000000000..3b4700994 --- /dev/null +++ b/iot/src/model/RecognizeCarNumRequest.cc @@ -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 + +using AlibabaCloud::Iot::Model::RecognizeCarNumRequest; + +RecognizeCarNumRequest::RecognizeCarNumRequest() : + RpcServiceRequest("iot", "2018-01-20", "RecognizeCarNum") +{ + setMethod(HttpRequest::Method::Post); +} + +RecognizeCarNumRequest::~RecognizeCarNumRequest() +{} + +std::string RecognizeCarNumRequest::getUrl()const +{ + return url_; +} + +void RecognizeCarNumRequest::setUrl(const std::string& url) +{ + url_ = url; + setParameter("Url", url); +} + +std::string RecognizeCarNumRequest::getApiProduct()const +{ + return apiProduct_; +} + +void RecognizeCarNumRequest::setApiProduct(const std::string& apiProduct) +{ + apiProduct_ = apiProduct; + setBodyParameter("ApiProduct", apiProduct); +} + +std::string RecognizeCarNumRequest::getApiRevision()const +{ + return apiRevision_; +} + +void RecognizeCarNumRequest::setApiRevision(const std::string& apiRevision) +{ + apiRevision_ = apiRevision; + setBodyParameter("ApiRevision", apiRevision); +} + diff --git a/iot/src/model/RecognizeCarNumResult.cc b/iot/src/model/RecognizeCarNumResult.cc new file mode 100644 index 000000000..a0c4bd32c --- /dev/null +++ b/iot/src/model/RecognizeCarNumResult.cc @@ -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 +#include + +using namespace AlibabaCloud::Iot; +using namespace AlibabaCloud::Iot::Model; + +RecognizeCarNumResult::RecognizeCarNumResult() : + ServiceResult() +{} + +RecognizeCarNumResult::RecognizeCarNumResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +RecognizeCarNumResult::~RecognizeCarNumResult() +{} + +void RecognizeCarNumResult::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 RecognizeCarNumResult::getData()const +{ + return data_; +} + +std::string RecognizeCarNumResult::getErrorMessage()const +{ + return errorMessage_; +} + +std::string RecognizeCarNumResult::getCode()const +{ + return code_; +} + +bool RecognizeCarNumResult::getSuccess()const +{ + return success_; +} + diff --git a/iot/src/model/RecognizePictureGeneralRequest.cc b/iot/src/model/RecognizePictureGeneralRequest.cc new file mode 100644 index 000000000..091f23bc7 --- /dev/null +++ b/iot/src/model/RecognizePictureGeneralRequest.cc @@ -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 + +using AlibabaCloud::Iot::Model::RecognizePictureGeneralRequest; + +RecognizePictureGeneralRequest::RecognizePictureGeneralRequest() : + RpcServiceRequest("iot", "2018-01-20", "RecognizePictureGeneral") +{ + setMethod(HttpRequest::Method::Post); +} + +RecognizePictureGeneralRequest::~RecognizePictureGeneralRequest() +{} + +std::string RecognizePictureGeneralRequest::getUrl()const +{ + return url_; +} + +void RecognizePictureGeneralRequest::setUrl(const std::string& url) +{ + url_ = url; + setParameter("Url", url); +} + +std::string RecognizePictureGeneralRequest::getApiProduct()const +{ + return apiProduct_; +} + +void RecognizePictureGeneralRequest::setApiProduct(const std::string& apiProduct) +{ + apiProduct_ = apiProduct; + setBodyParameter("ApiProduct", apiProduct); +} + +std::string RecognizePictureGeneralRequest::getApiRevision()const +{ + return apiRevision_; +} + +void RecognizePictureGeneralRequest::setApiRevision(const std::string& apiRevision) +{ + apiRevision_ = apiRevision; + setBodyParameter("ApiRevision", apiRevision); +} + diff --git a/iot/src/model/RecognizePictureGeneralResult.cc b/iot/src/model/RecognizePictureGeneralResult.cc new file mode 100644 index 000000000..367e5486f --- /dev/null +++ b/iot/src/model/RecognizePictureGeneralResult.cc @@ -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 +#include + +using namespace AlibabaCloud::Iot; +using namespace AlibabaCloud::Iot::Model; + +RecognizePictureGeneralResult::RecognizePictureGeneralResult() : + ServiceResult() +{} + +RecognizePictureGeneralResult::RecognizePictureGeneralResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +RecognizePictureGeneralResult::~RecognizePictureGeneralResult() +{} + +void RecognizePictureGeneralResult::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 RecognizePictureGeneralResult::getData()const +{ + return data_; +} + +std::string RecognizePictureGeneralResult::getErrorMessage()const +{ + return errorMessage_; +} + +std::string RecognizePictureGeneralResult::getCode()const +{ + return code_; +} + +bool RecognizePictureGeneralResult::getSuccess()const +{ + return success_; +} +