From cffe37f2e6f1f5487c3e653884afc11a7c3b17e9 Mon Sep 17 00:00:00 2001 From: sdk-team Date: Thu, 31 Mar 2022 02:42:57 +0000 Subject: [PATCH] CreateDataSourceItem. --- CHANGELOG | 4 + VERSION | 2 +- iot/CMakeLists.txt | 8 ++ iot/include/alibabacloud/iot/IotClient.h | 16 +++ .../iot/model/CreateDataSourceItemRequest.h | 60 ++++++++++ .../iot/model/CreateDataSourceItemResult.h | 55 +++++++++ .../iot/model/ListDataSourceItemRequest.h | 66 +++++++++++ .../iot/model/ListDataSourceItemResult.h | 68 +++++++++++ .../iot/model/ListDistributedProductResult.h | 2 +- iot/src/IotClient.cc | 72 ++++++++++++ iot/src/model/CreateDataSourceItemRequest.cc | 84 ++++++++++++++ iot/src/model/CreateDataSourceItemResult.cc | 65 +++++++++++ iot/src/model/ListDataSourceItemRequest.cc | 106 ++++++++++++++++++ iot/src/model/ListDataSourceItemResult.cc | 101 +++++++++++++++++ iot/src/model/ListDistributedProductResult.cc | 2 +- 15 files changed, 708 insertions(+), 3 deletions(-) create mode 100644 iot/include/alibabacloud/iot/model/CreateDataSourceItemRequest.h create mode 100644 iot/include/alibabacloud/iot/model/CreateDataSourceItemResult.h create mode 100644 iot/include/alibabacloud/iot/model/ListDataSourceItemRequest.h create mode 100644 iot/include/alibabacloud/iot/model/ListDataSourceItemResult.h create mode 100644 iot/src/model/CreateDataSourceItemRequest.cc create mode 100644 iot/src/model/CreateDataSourceItemResult.cc create mode 100644 iot/src/model/ListDataSourceItemRequest.cc create mode 100644 iot/src/model/ListDataSourceItemResult.cc diff --git a/CHANGELOG b/CHANGELOG index 7329fd0ae..430f48890 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,7 @@ +2022-03-31 Version: 1.36.1094 +- CreateDataSourceItem. +- ListDataSourceItem. + 2022-03-30 Version: 1.36.1093 - Generated 2016-11-01 for `live`. diff --git a/VERSION b/VERSION index 8059bf9e2..cf1c809db 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.1093 \ No newline at end of file +1.36.1094 \ No newline at end of file diff --git a/iot/CMakeLists.txt b/iot/CMakeLists.txt index 5915d2a18..7dbf94678 100644 --- a/iot/CMakeLists.txt +++ b/iot/CMakeLists.txt @@ -115,6 +115,8 @@ set(iot_public_header_model include/alibabacloud/iot/model/CreateConsumerGroupSubscribeRelationResult.h include/alibabacloud/iot/model/CreateDataAPIServiceRequest.h include/alibabacloud/iot/model/CreateDataAPIServiceResult.h + include/alibabacloud/iot/model/CreateDataSourceItemRequest.h + include/alibabacloud/iot/model/CreateDataSourceItemResult.h include/alibabacloud/iot/model/CreateDeviceDistributeJobRequest.h include/alibabacloud/iot/model/CreateDeviceDistributeJobResult.h include/alibabacloud/iot/model/CreateDeviceDynamicGroupRequest.h @@ -321,6 +323,8 @@ set(iot_public_header_model include/alibabacloud/iot/model/InvokeThingsServiceResult.h include/alibabacloud/iot/model/ListAnalyticsDataRequest.h include/alibabacloud/iot/model/ListAnalyticsDataResult.h + include/alibabacloud/iot/model/ListDataSourceItemRequest.h + include/alibabacloud/iot/model/ListDataSourceItemResult.h include/alibabacloud/iot/model/ListDeviceDistributeJobRequest.h include/alibabacloud/iot/model/ListDeviceDistributeJobResult.h include/alibabacloud/iot/model/ListDistributedDeviceRequest.h @@ -750,6 +754,8 @@ set(iot_src src/model/CreateConsumerGroupSubscribeRelationResult.cc src/model/CreateDataAPIServiceRequest.cc src/model/CreateDataAPIServiceResult.cc + src/model/CreateDataSourceItemRequest.cc + src/model/CreateDataSourceItemResult.cc src/model/CreateDeviceDistributeJobRequest.cc src/model/CreateDeviceDistributeJobResult.cc src/model/CreateDeviceDynamicGroupRequest.cc @@ -956,6 +962,8 @@ set(iot_src src/model/InvokeThingsServiceResult.cc src/model/ListAnalyticsDataRequest.cc src/model/ListAnalyticsDataResult.cc + src/model/ListDataSourceItemRequest.cc + src/model/ListDataSourceItemResult.cc src/model/ListDeviceDistributeJobRequest.cc src/model/ListDeviceDistributeJobResult.cc src/model/ListDistributedDeviceRequest.cc diff --git a/iot/include/alibabacloud/iot/IotClient.h b/iot/include/alibabacloud/iot/IotClient.h index 589a74ef7..e38ccb400 100644 --- a/iot/include/alibabacloud/iot/IotClient.h +++ b/iot/include/alibabacloud/iot/IotClient.h @@ -116,6 +116,8 @@ #include "model/CreateConsumerGroupSubscribeRelationResult.h" #include "model/CreateDataAPIServiceRequest.h" #include "model/CreateDataAPIServiceResult.h" +#include "model/CreateDataSourceItemRequest.h" +#include "model/CreateDataSourceItemResult.h" #include "model/CreateDeviceDistributeJobRequest.h" #include "model/CreateDeviceDistributeJobResult.h" #include "model/CreateDeviceDynamicGroupRequest.h" @@ -322,6 +324,8 @@ #include "model/InvokeThingsServiceResult.h" #include "model/ListAnalyticsDataRequest.h" #include "model/ListAnalyticsDataResult.h" +#include "model/ListDataSourceItemRequest.h" +#include "model/ListDataSourceItemResult.h" #include "model/ListDeviceDistributeJobRequest.h" #include "model/ListDeviceDistributeJobResult.h" #include "model/ListDistributedDeviceRequest.h" @@ -804,6 +808,9 @@ namespace AlibabaCloud typedef Outcome CreateDataAPIServiceOutcome; typedef std::future CreateDataAPIServiceOutcomeCallable; typedef std::function&)> CreateDataAPIServiceAsyncHandler; + typedef Outcome CreateDataSourceItemOutcome; + typedef std::future CreateDataSourceItemOutcomeCallable; + typedef std::function&)> CreateDataSourceItemAsyncHandler; typedef Outcome CreateDeviceDistributeJobOutcome; typedef std::future CreateDeviceDistributeJobOutcomeCallable; typedef std::function&)> CreateDeviceDistributeJobAsyncHandler; @@ -1113,6 +1120,9 @@ namespace AlibabaCloud typedef Outcome ListAnalyticsDataOutcome; typedef std::future ListAnalyticsDataOutcomeCallable; typedef std::function&)> ListAnalyticsDataAsyncHandler; + typedef Outcome ListDataSourceItemOutcome; + typedef std::future ListDataSourceItemOutcomeCallable; + typedef std::function&)> ListDataSourceItemAsyncHandler; typedef Outcome ListDeviceDistributeJobOutcome; typedef std::future ListDeviceDistributeJobOutcomeCallable; typedef std::function&)> ListDeviceDistributeJobAsyncHandler; @@ -1757,6 +1767,9 @@ namespace AlibabaCloud CreateDataAPIServiceOutcome createDataAPIService(const Model::CreateDataAPIServiceRequest &request)const; void createDataAPIServiceAsync(const Model::CreateDataAPIServiceRequest& request, const CreateDataAPIServiceAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; CreateDataAPIServiceOutcomeCallable createDataAPIServiceCallable(const Model::CreateDataAPIServiceRequest& request) const; + CreateDataSourceItemOutcome createDataSourceItem(const Model::CreateDataSourceItemRequest &request)const; + void createDataSourceItemAsync(const Model::CreateDataSourceItemRequest& request, const CreateDataSourceItemAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + CreateDataSourceItemOutcomeCallable createDataSourceItemCallable(const Model::CreateDataSourceItemRequest& request) const; CreateDeviceDistributeJobOutcome createDeviceDistributeJob(const Model::CreateDeviceDistributeJobRequest &request)const; void createDeviceDistributeJobAsync(const Model::CreateDeviceDistributeJobRequest& request, const CreateDeviceDistributeJobAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; CreateDeviceDistributeJobOutcomeCallable createDeviceDistributeJobCallable(const Model::CreateDeviceDistributeJobRequest& request) const; @@ -2066,6 +2079,9 @@ namespace AlibabaCloud ListAnalyticsDataOutcome listAnalyticsData(const Model::ListAnalyticsDataRequest &request)const; void listAnalyticsDataAsync(const Model::ListAnalyticsDataRequest& request, const ListAnalyticsDataAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; ListAnalyticsDataOutcomeCallable listAnalyticsDataCallable(const Model::ListAnalyticsDataRequest& request) const; + ListDataSourceItemOutcome listDataSourceItem(const Model::ListDataSourceItemRequest &request)const; + void listDataSourceItemAsync(const Model::ListDataSourceItemRequest& request, const ListDataSourceItemAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + ListDataSourceItemOutcomeCallable listDataSourceItemCallable(const Model::ListDataSourceItemRequest& request) const; ListDeviceDistributeJobOutcome listDeviceDistributeJob(const Model::ListDeviceDistributeJobRequest &request)const; void listDeviceDistributeJobAsync(const Model::ListDeviceDistributeJobRequest& request, const ListDeviceDistributeJobAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; ListDeviceDistributeJobOutcomeCallable listDeviceDistributeJobCallable(const Model::ListDeviceDistributeJobRequest& request) const; diff --git a/iot/include/alibabacloud/iot/model/CreateDataSourceItemRequest.h b/iot/include/alibabacloud/iot/model/CreateDataSourceItemRequest.h new file mode 100644 index 000000000..6df322997 --- /dev/null +++ b/iot/include/alibabacloud/iot/model/CreateDataSourceItemRequest.h @@ -0,0 +1,60 @@ +/* + * 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_CREATEDATASOURCEITEMREQUEST_H_ +#define ALIBABACLOUD_IOT_MODEL_CREATEDATASOURCEITEMREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Iot + { + namespace Model + { + class ALIBABACLOUD_IOT_EXPORT CreateDataSourceItemRequest : public RpcServiceRequest + { + + public: + CreateDataSourceItemRequest(); + ~CreateDataSourceItemRequest(); + + std::string getIotInstanceId()const; + void setIotInstanceId(const std::string& iotInstanceId); + std::string getApiProduct()const; + void setApiProduct(const std::string& apiProduct); + long getDataSourceId()const; + void setDataSourceId(long dataSourceId); + std::string getTopic()const; + void setTopic(const std::string& topic); + std::string getApiRevision()const; + void setApiRevision(const std::string& apiRevision); + + private: + std::string iotInstanceId_; + std::string apiProduct_; + long dataSourceId_; + std::string topic_; + std::string apiRevision_; + + }; + } + } +} +#endif // !ALIBABACLOUD_IOT_MODEL_CREATEDATASOURCEITEMREQUEST_H_ \ No newline at end of file diff --git a/iot/include/alibabacloud/iot/model/CreateDataSourceItemResult.h b/iot/include/alibabacloud/iot/model/CreateDataSourceItemResult.h new file mode 100644 index 000000000..edccccb7f --- /dev/null +++ b/iot/include/alibabacloud/iot/model/CreateDataSourceItemResult.h @@ -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_CREATEDATASOURCEITEMRESULT_H_ +#define ALIBABACLOUD_IOT_MODEL_CREATEDATASOURCEITEMRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Iot + { + namespace Model + { + class ALIBABACLOUD_IOT_EXPORT CreateDataSourceItemResult : public ServiceResult + { + public: + + + CreateDataSourceItemResult(); + explicit CreateDataSourceItemResult(const std::string &payload); + ~CreateDataSourceItemResult(); + 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_CREATEDATASOURCEITEMRESULT_H_ \ No newline at end of file diff --git a/iot/include/alibabacloud/iot/model/ListDataSourceItemRequest.h b/iot/include/alibabacloud/iot/model/ListDataSourceItemRequest.h new file mode 100644 index 000000000..e6d767b08 --- /dev/null +++ b/iot/include/alibabacloud/iot/model/ListDataSourceItemRequest.h @@ -0,0 +1,66 @@ +/* + * 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_LISTDATASOURCEITEMREQUEST_H_ +#define ALIBABACLOUD_IOT_MODEL_LISTDATASOURCEITEMREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Iot + { + namespace Model + { + class ALIBABACLOUD_IOT_EXPORT ListDataSourceItemRequest : public RpcServiceRequest + { + + public: + ListDataSourceItemRequest(); + ~ListDataSourceItemRequest(); + + std::string getSearchName()const; + void setSearchName(const std::string& searchName); + std::string getIotInstanceId()const; + void setIotInstanceId(const std::string& iotInstanceId); + int getPageSize()const; + void setPageSize(int pageSize); + std::string getApiProduct()const; + void setApiProduct(const std::string& apiProduct); + long getDataSourceId()const; + void setDataSourceId(long dataSourceId); + std::string getApiRevision()const; + void setApiRevision(const std::string& apiRevision); + int getPage()const; + void setPage(int page); + + private: + std::string searchName_; + std::string iotInstanceId_; + int pageSize_; + std::string apiProduct_; + long dataSourceId_; + std::string apiRevision_; + int page_; + + }; + } + } +} +#endif // !ALIBABACLOUD_IOT_MODEL_LISTDATASOURCEITEMREQUEST_H_ \ No newline at end of file diff --git a/iot/include/alibabacloud/iot/model/ListDataSourceItemResult.h b/iot/include/alibabacloud/iot/model/ListDataSourceItemResult.h new file mode 100644 index 000000000..f57203d3e --- /dev/null +++ b/iot/include/alibabacloud/iot/model/ListDataSourceItemResult.h @@ -0,0 +1,68 @@ +/* + * 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_LISTDATASOURCEITEMRESULT_H_ +#define ALIBABACLOUD_IOT_MODEL_LISTDATASOURCEITEMRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Iot + { + namespace Model + { + class ALIBABACLOUD_IOT_EXPORT ListDataSourceItemResult : public ServiceResult + { + public: + struct DataSourceItem + { + long dataSourceItemId; + std::string topic; + }; + + + ListDataSourceItemResult(); + explicit ListDataSourceItemResult(const std::string &payload); + ~ListDataSourceItemResult(); + std::vector getDataSourceItems()const; + int getPageSize()const; + int getTotal()const; + int getPage()const; + std::string getErrorMessage()const; + std::string getCode()const; + bool getSuccess()const; + + protected: + void parse(const std::string &payload); + private: + std::vector dataSourceItems_; + int pageSize_; + int total_; + int page_; + std::string errorMessage_; + std::string code_; + bool success_; + + }; + } + } +} +#endif // !ALIBABACLOUD_IOT_MODEL_LISTDATASOURCEITEMRESULT_H_ \ No newline at end of file diff --git a/iot/include/alibabacloud/iot/model/ListDistributedProductResult.h b/iot/include/alibabacloud/iot/model/ListDistributedProductResult.h index 3c6d0d90d..dfddcc668 100644 --- a/iot/include/alibabacloud/iot/model/ListDistributedProductResult.h +++ b/iot/include/alibabacloud/iot/model/ListDistributedProductResult.h @@ -39,7 +39,7 @@ namespace AlibabaCloud std::string targetRegion; std::string targetAliyunId; std::string sourceInstanceName; - int gmtCreate; + long gmtCreate; std::string sourceUid; std::string targetInstanceName; std::string targetInstanceId; diff --git a/iot/src/IotClient.cc b/iot/src/IotClient.cc index 579c15db0..9191b30c0 100644 --- a/iot/src/IotClient.cc +++ b/iot/src/IotClient.cc @@ -1743,6 +1743,42 @@ IotClient::CreateDataAPIServiceOutcomeCallable IotClient::createDataAPIServiceCa return task->get_future(); } +IotClient::CreateDataSourceItemOutcome IotClient::createDataSourceItem(const CreateDataSourceItemRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return CreateDataSourceItemOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return CreateDataSourceItemOutcome(CreateDataSourceItemResult(outcome.result())); + else + return CreateDataSourceItemOutcome(outcome.error()); +} + +void IotClient::createDataSourceItemAsync(const CreateDataSourceItemRequest& request, const CreateDataSourceItemAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, createDataSourceItem(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +IotClient::CreateDataSourceItemOutcomeCallable IotClient::createDataSourceItemCallable(const CreateDataSourceItemRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->createDataSourceItem(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + IotClient::CreateDeviceDistributeJobOutcome IotClient::createDeviceDistributeJob(const CreateDeviceDistributeJobRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); @@ -5451,6 +5487,42 @@ IotClient::ListAnalyticsDataOutcomeCallable IotClient::listAnalyticsDataCallable return task->get_future(); } +IotClient::ListDataSourceItemOutcome IotClient::listDataSourceItem(const ListDataSourceItemRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return ListDataSourceItemOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return ListDataSourceItemOutcome(ListDataSourceItemResult(outcome.result())); + else + return ListDataSourceItemOutcome(outcome.error()); +} + +void IotClient::listDataSourceItemAsync(const ListDataSourceItemRequest& request, const ListDataSourceItemAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, listDataSourceItem(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +IotClient::ListDataSourceItemOutcomeCallable IotClient::listDataSourceItemCallable(const ListDataSourceItemRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->listDataSourceItem(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + IotClient::ListDeviceDistributeJobOutcome IotClient::listDeviceDistributeJob(const ListDeviceDistributeJobRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); diff --git a/iot/src/model/CreateDataSourceItemRequest.cc b/iot/src/model/CreateDataSourceItemRequest.cc new file mode 100644 index 000000000..397283b4e --- /dev/null +++ b/iot/src/model/CreateDataSourceItemRequest.cc @@ -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 + +using AlibabaCloud::Iot::Model::CreateDataSourceItemRequest; + +CreateDataSourceItemRequest::CreateDataSourceItemRequest() : + RpcServiceRequest("iot", "2018-01-20", "CreateDataSourceItem") +{ + setMethod(HttpRequest::Method::Post); +} + +CreateDataSourceItemRequest::~CreateDataSourceItemRequest() +{} + +std::string CreateDataSourceItemRequest::getIotInstanceId()const +{ + return iotInstanceId_; +} + +void CreateDataSourceItemRequest::setIotInstanceId(const std::string& iotInstanceId) +{ + iotInstanceId_ = iotInstanceId; + setParameter("IotInstanceId", iotInstanceId); +} + +std::string CreateDataSourceItemRequest::getApiProduct()const +{ + return apiProduct_; +} + +void CreateDataSourceItemRequest::setApiProduct(const std::string& apiProduct) +{ + apiProduct_ = apiProduct; + setBodyParameter("ApiProduct", apiProduct); +} + +long CreateDataSourceItemRequest::getDataSourceId()const +{ + return dataSourceId_; +} + +void CreateDataSourceItemRequest::setDataSourceId(long dataSourceId) +{ + dataSourceId_ = dataSourceId; + setParameter("DataSourceId", std::to_string(dataSourceId)); +} + +std::string CreateDataSourceItemRequest::getTopic()const +{ + return topic_; +} + +void CreateDataSourceItemRequest::setTopic(const std::string& topic) +{ + topic_ = topic; + setParameter("Topic", topic); +} + +std::string CreateDataSourceItemRequest::getApiRevision()const +{ + return apiRevision_; +} + +void CreateDataSourceItemRequest::setApiRevision(const std::string& apiRevision) +{ + apiRevision_ = apiRevision; + setBodyParameter("ApiRevision", apiRevision); +} + diff --git a/iot/src/model/CreateDataSourceItemResult.cc b/iot/src/model/CreateDataSourceItemResult.cc new file mode 100644 index 000000000..c6ca87703 --- /dev/null +++ b/iot/src/model/CreateDataSourceItemResult.cc @@ -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 +#include + +using namespace AlibabaCloud::Iot; +using namespace AlibabaCloud::Iot::Model; + +CreateDataSourceItemResult::CreateDataSourceItemResult() : + ServiceResult() +{} + +CreateDataSourceItemResult::CreateDataSourceItemResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +CreateDataSourceItemResult::~CreateDataSourceItemResult() +{} + +void CreateDataSourceItemResult::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 CreateDataSourceItemResult::getErrorMessage()const +{ + return errorMessage_; +} + +std::string CreateDataSourceItemResult::getCode()const +{ + return code_; +} + +bool CreateDataSourceItemResult::getSuccess()const +{ + return success_; +} + diff --git a/iot/src/model/ListDataSourceItemRequest.cc b/iot/src/model/ListDataSourceItemRequest.cc new file mode 100644 index 000000000..caf492e2d --- /dev/null +++ b/iot/src/model/ListDataSourceItemRequest.cc @@ -0,0 +1,106 @@ +/* + * 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::ListDataSourceItemRequest; + +ListDataSourceItemRequest::ListDataSourceItemRequest() : + RpcServiceRequest("iot", "2018-01-20", "ListDataSourceItem") +{ + setMethod(HttpRequest::Method::Post); +} + +ListDataSourceItemRequest::~ListDataSourceItemRequest() +{} + +std::string ListDataSourceItemRequest::getSearchName()const +{ + return searchName_; +} + +void ListDataSourceItemRequest::setSearchName(const std::string& searchName) +{ + searchName_ = searchName; + setParameter("SearchName", searchName); +} + +std::string ListDataSourceItemRequest::getIotInstanceId()const +{ + return iotInstanceId_; +} + +void ListDataSourceItemRequest::setIotInstanceId(const std::string& iotInstanceId) +{ + iotInstanceId_ = iotInstanceId; + setParameter("IotInstanceId", iotInstanceId); +} + +int ListDataSourceItemRequest::getPageSize()const +{ + return pageSize_; +} + +void ListDataSourceItemRequest::setPageSize(int pageSize) +{ + pageSize_ = pageSize; + setParameter("PageSize", std::to_string(pageSize)); +} + +std::string ListDataSourceItemRequest::getApiProduct()const +{ + return apiProduct_; +} + +void ListDataSourceItemRequest::setApiProduct(const std::string& apiProduct) +{ + apiProduct_ = apiProduct; + setBodyParameter("ApiProduct", apiProduct); +} + +long ListDataSourceItemRequest::getDataSourceId()const +{ + return dataSourceId_; +} + +void ListDataSourceItemRequest::setDataSourceId(long dataSourceId) +{ + dataSourceId_ = dataSourceId; + setParameter("DataSourceId", std::to_string(dataSourceId)); +} + +std::string ListDataSourceItemRequest::getApiRevision()const +{ + return apiRevision_; +} + +void ListDataSourceItemRequest::setApiRevision(const std::string& apiRevision) +{ + apiRevision_ = apiRevision; + setBodyParameter("ApiRevision", apiRevision); +} + +int ListDataSourceItemRequest::getPage()const +{ + return page_; +} + +void ListDataSourceItemRequest::setPage(int page) +{ + page_ = page; + setParameter("Page", std::to_string(page)); +} + diff --git a/iot/src/model/ListDataSourceItemResult.cc b/iot/src/model/ListDataSourceItemResult.cc new file mode 100644 index 000000000..53142ba74 --- /dev/null +++ b/iot/src/model/ListDataSourceItemResult.cc @@ -0,0 +1,101 @@ +/* + * 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; + +ListDataSourceItemResult::ListDataSourceItemResult() : + ServiceResult() +{} + +ListDataSourceItemResult::ListDataSourceItemResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +ListDataSourceItemResult::~ListDataSourceItemResult() +{} + +void ListDataSourceItemResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto allDataSourceItemsNode = value["DataSourceItems"]["dataSourceItem"]; + for (auto valueDataSourceItemsdataSourceItem : allDataSourceItemsNode) + { + DataSourceItem dataSourceItemsObject; + if(!valueDataSourceItemsdataSourceItem["DataSourceItemId"].isNull()) + dataSourceItemsObject.dataSourceItemId = std::stol(valueDataSourceItemsdataSourceItem["DataSourceItemId"].asString()); + if(!valueDataSourceItemsdataSourceItem["Topic"].isNull()) + dataSourceItemsObject.topic = valueDataSourceItemsdataSourceItem["Topic"].asString(); + dataSourceItems_.push_back(dataSourceItemsObject); + } + 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["Page"].isNull()) + page_ = std::stoi(value["Page"].asString()); + if(!value["PageSize"].isNull()) + pageSize_ = std::stoi(value["PageSize"].asString()); + if(!value["Total"].isNull()) + total_ = std::stoi(value["Total"].asString()); + +} + +std::vector ListDataSourceItemResult::getDataSourceItems()const +{ + return dataSourceItems_; +} + +int ListDataSourceItemResult::getPageSize()const +{ + return pageSize_; +} + +int ListDataSourceItemResult::getTotal()const +{ + return total_; +} + +int ListDataSourceItemResult::getPage()const +{ + return page_; +} + +std::string ListDataSourceItemResult::getErrorMessage()const +{ + return errorMessage_; +} + +std::string ListDataSourceItemResult::getCode()const +{ + return code_; +} + +bool ListDataSourceItemResult::getSuccess()const +{ + return success_; +} + diff --git a/iot/src/model/ListDistributedProductResult.cc b/iot/src/model/ListDistributedProductResult.cc index b4e6455db..50ae8de07 100644 --- a/iot/src/model/ListDistributedProductResult.cc +++ b/iot/src/model/ListDistributedProductResult.cc @@ -57,7 +57,7 @@ void ListDistributedProductResult::parse(const std::string &payload) if(!dataNodeInfoitems["TargetInstanceId"].isNull()) itemsObject.targetInstanceId = dataNodeInfoitems["TargetInstanceId"].asString(); if(!dataNodeInfoitems["GmtCreate"].isNull()) - itemsObject.gmtCreate = std::stoi(dataNodeInfoitems["GmtCreate"].asString()); + itemsObject.gmtCreate = std::stol(dataNodeInfoitems["GmtCreate"].asString()); if(!dataNodeInfoitems["TargetAliyunId"].isNull()) itemsObject.targetAliyunId = dataNodeInfoitems["TargetAliyunId"].asString(); if(!dataNodeInfoitems["SourceRegion"].isNull())