diff --git a/VERSION b/VERSION index 5ef16e0be..2bcedf27a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.1235 \ No newline at end of file +1.36.1236 \ No newline at end of file diff --git a/iot/CMakeLists.txt b/iot/CMakeLists.txt index 7a9b92fe0..4fb70ab04 100644 --- a/iot/CMakeLists.txt +++ b/iot/CMakeLists.txt @@ -145,6 +145,8 @@ set(iot_public_header_model include/alibabacloud/iot/model/CreateDeviceGroupResult.h include/alibabacloud/iot/model/CreateDeviceTunnelRequest.h include/alibabacloud/iot/model/CreateDeviceTunnelResult.h + include/alibabacloud/iot/model/CreateDownloadDataJobRequest.h + include/alibabacloud/iot/model/CreateDownloadDataJobResult.h include/alibabacloud/iot/model/CreateEdgeDriverRequest.h include/alibabacloud/iot/model/CreateEdgeDriverResult.h include/alibabacloud/iot/model/CreateEdgeDriverVersionRequest.h @@ -323,6 +325,8 @@ set(iot_public_header_model include/alibabacloud/iot/model/GetDeviceTunnelShareStatusResult.h include/alibabacloud/iot/model/GetDeviceTunnelStatusRequest.h include/alibabacloud/iot/model/GetDeviceTunnelStatusResult.h + include/alibabacloud/iot/model/GetDownloadFileRequest.h + include/alibabacloud/iot/model/GetDownloadFileResult.h include/alibabacloud/iot/model/GetEdgeDriverVersionRequest.h include/alibabacloud/iot/model/GetEdgeDriverVersionResult.h include/alibabacloud/iot/model/GetEdgeInstanceRequest.h @@ -521,6 +525,8 @@ set(iot_public_header_model include/alibabacloud/iot/model/QueryDeviceSpeechResult.h include/alibabacloud/iot/model/QueryDeviceStatisticsRequest.h include/alibabacloud/iot/model/QueryDeviceStatisticsResult.h + include/alibabacloud/iot/model/QueryDeviceSubTopicRequest.h + include/alibabacloud/iot/model/QueryDeviceSubTopicResult.h include/alibabacloud/iot/model/QueryDeviceTunnelRequest.h include/alibabacloud/iot/model/QueryDeviceTunnelResult.h include/alibabacloud/iot/model/QueryDynamicGroupDevicesRequest.h @@ -892,6 +898,8 @@ set(iot_src src/model/CreateDeviceGroupResult.cc src/model/CreateDeviceTunnelRequest.cc src/model/CreateDeviceTunnelResult.cc + src/model/CreateDownloadDataJobRequest.cc + src/model/CreateDownloadDataJobResult.cc src/model/CreateEdgeDriverRequest.cc src/model/CreateEdgeDriverResult.cc src/model/CreateEdgeDriverVersionRequest.cc @@ -1070,6 +1078,8 @@ set(iot_src src/model/GetDeviceTunnelShareStatusResult.cc src/model/GetDeviceTunnelStatusRequest.cc src/model/GetDeviceTunnelStatusResult.cc + src/model/GetDownloadFileRequest.cc + src/model/GetDownloadFileResult.cc src/model/GetEdgeDriverVersionRequest.cc src/model/GetEdgeDriverVersionResult.cc src/model/GetEdgeInstanceRequest.cc @@ -1268,6 +1278,8 @@ set(iot_src src/model/QueryDeviceSpeechResult.cc src/model/QueryDeviceStatisticsRequest.cc src/model/QueryDeviceStatisticsResult.cc + src/model/QueryDeviceSubTopicRequest.cc + src/model/QueryDeviceSubTopicResult.cc src/model/QueryDeviceTunnelRequest.cc src/model/QueryDeviceTunnelResult.cc src/model/QueryDynamicGroupDevicesRequest.cc diff --git a/iot/include/alibabacloud/iot/IotClient.h b/iot/include/alibabacloud/iot/IotClient.h index 2d1b6d3cc..d5ab8bd77 100644 --- a/iot/include/alibabacloud/iot/IotClient.h +++ b/iot/include/alibabacloud/iot/IotClient.h @@ -146,6 +146,8 @@ #include "model/CreateDeviceGroupResult.h" #include "model/CreateDeviceTunnelRequest.h" #include "model/CreateDeviceTunnelResult.h" +#include "model/CreateDownloadDataJobRequest.h" +#include "model/CreateDownloadDataJobResult.h" #include "model/CreateEdgeDriverRequest.h" #include "model/CreateEdgeDriverResult.h" #include "model/CreateEdgeDriverVersionRequest.h" @@ -324,6 +326,8 @@ #include "model/GetDeviceTunnelShareStatusResult.h" #include "model/GetDeviceTunnelStatusRequest.h" #include "model/GetDeviceTunnelStatusResult.h" +#include "model/GetDownloadFileRequest.h" +#include "model/GetDownloadFileResult.h" #include "model/GetEdgeDriverVersionRequest.h" #include "model/GetEdgeDriverVersionResult.h" #include "model/GetEdgeInstanceRequest.h" @@ -522,6 +526,8 @@ #include "model/QueryDeviceSpeechResult.h" #include "model/QueryDeviceStatisticsRequest.h" #include "model/QueryDeviceStatisticsResult.h" +#include "model/QueryDeviceSubTopicRequest.h" +#include "model/QueryDeviceSubTopicResult.h" #include "model/QueryDeviceTunnelRequest.h" #include "model/QueryDeviceTunnelResult.h" #include "model/QueryDynamicGroupDevicesRequest.h" @@ -961,6 +967,9 @@ namespace AlibabaCloud typedef Outcome CreateDeviceTunnelOutcome; typedef std::future CreateDeviceTunnelOutcomeCallable; typedef std::function&)> CreateDeviceTunnelAsyncHandler; + typedef Outcome CreateDownloadDataJobOutcome; + typedef std::future CreateDownloadDataJobOutcomeCallable; + typedef std::function&)> CreateDownloadDataJobAsyncHandler; typedef Outcome CreateEdgeDriverOutcome; typedef std::future CreateEdgeDriverOutcomeCallable; typedef std::function&)> CreateEdgeDriverAsyncHandler; @@ -1228,6 +1237,9 @@ namespace AlibabaCloud typedef Outcome GetDeviceTunnelStatusOutcome; typedef std::future GetDeviceTunnelStatusOutcomeCallable; typedef std::function&)> GetDeviceTunnelStatusAsyncHandler; + typedef Outcome GetDownloadFileOutcome; + typedef std::future GetDownloadFileOutcomeCallable; + typedef std::function&)> GetDownloadFileAsyncHandler; typedef Outcome GetEdgeDriverVersionOutcome; typedef std::future GetEdgeDriverVersionOutcomeCallable; typedef std::function&)> GetEdgeDriverVersionAsyncHandler; @@ -1525,6 +1537,9 @@ namespace AlibabaCloud typedef Outcome QueryDeviceStatisticsOutcome; typedef std::future QueryDeviceStatisticsOutcomeCallable; typedef std::function&)> QueryDeviceStatisticsAsyncHandler; + typedef Outcome QueryDeviceSubTopicOutcome; + typedef std::future QueryDeviceSubTopicOutcomeCallable; + typedef std::function&)> QueryDeviceSubTopicAsyncHandler; typedef Outcome QueryDeviceTunnelOutcome; typedef std::future QueryDeviceTunnelOutcomeCallable; typedef std::function&)> QueryDeviceTunnelAsyncHandler; @@ -2082,6 +2097,9 @@ namespace AlibabaCloud CreateDeviceTunnelOutcome createDeviceTunnel(const Model::CreateDeviceTunnelRequest &request)const; void createDeviceTunnelAsync(const Model::CreateDeviceTunnelRequest& request, const CreateDeviceTunnelAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; CreateDeviceTunnelOutcomeCallable createDeviceTunnelCallable(const Model::CreateDeviceTunnelRequest& request) const; + CreateDownloadDataJobOutcome createDownloadDataJob(const Model::CreateDownloadDataJobRequest &request)const; + void createDownloadDataJobAsync(const Model::CreateDownloadDataJobRequest& request, const CreateDownloadDataJobAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + CreateDownloadDataJobOutcomeCallable createDownloadDataJobCallable(const Model::CreateDownloadDataJobRequest& request) const; CreateEdgeDriverOutcome createEdgeDriver(const Model::CreateEdgeDriverRequest &request)const; void createEdgeDriverAsync(const Model::CreateEdgeDriverRequest& request, const CreateEdgeDriverAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; CreateEdgeDriverOutcomeCallable createEdgeDriverCallable(const Model::CreateEdgeDriverRequest& request) const; @@ -2349,6 +2367,9 @@ namespace AlibabaCloud GetDeviceTunnelStatusOutcome getDeviceTunnelStatus(const Model::GetDeviceTunnelStatusRequest &request)const; void getDeviceTunnelStatusAsync(const Model::GetDeviceTunnelStatusRequest& request, const GetDeviceTunnelStatusAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; GetDeviceTunnelStatusOutcomeCallable getDeviceTunnelStatusCallable(const Model::GetDeviceTunnelStatusRequest& request) const; + GetDownloadFileOutcome getDownloadFile(const Model::GetDownloadFileRequest &request)const; + void getDownloadFileAsync(const Model::GetDownloadFileRequest& request, const GetDownloadFileAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + GetDownloadFileOutcomeCallable getDownloadFileCallable(const Model::GetDownloadFileRequest& request) const; GetEdgeDriverVersionOutcome getEdgeDriverVersion(const Model::GetEdgeDriverVersionRequest &request)const; void getEdgeDriverVersionAsync(const Model::GetEdgeDriverVersionRequest& request, const GetEdgeDriverVersionAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; GetEdgeDriverVersionOutcomeCallable getEdgeDriverVersionCallable(const Model::GetEdgeDriverVersionRequest& request) const; @@ -2646,6 +2667,9 @@ namespace AlibabaCloud QueryDeviceStatisticsOutcome queryDeviceStatistics(const Model::QueryDeviceStatisticsRequest &request)const; void queryDeviceStatisticsAsync(const Model::QueryDeviceStatisticsRequest& request, const QueryDeviceStatisticsAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; QueryDeviceStatisticsOutcomeCallable queryDeviceStatisticsCallable(const Model::QueryDeviceStatisticsRequest& request) const; + QueryDeviceSubTopicOutcome queryDeviceSubTopic(const Model::QueryDeviceSubTopicRequest &request)const; + void queryDeviceSubTopicAsync(const Model::QueryDeviceSubTopicRequest& request, const QueryDeviceSubTopicAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + QueryDeviceSubTopicOutcomeCallable queryDeviceSubTopicCallable(const Model::QueryDeviceSubTopicRequest& request) const; QueryDeviceTunnelOutcome queryDeviceTunnel(const Model::QueryDeviceTunnelRequest &request)const; void queryDeviceTunnelAsync(const Model::QueryDeviceTunnelRequest& request, const QueryDeviceTunnelAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; QueryDeviceTunnelOutcomeCallable queryDeviceTunnelCallable(const Model::QueryDeviceTunnelRequest& request) const; diff --git a/iot/include/alibabacloud/iot/model/CreateDownloadDataJobRequest.h b/iot/include/alibabacloud/iot/model/CreateDownloadDataJobRequest.h new file mode 100644 index 000000000..650584fdb --- /dev/null +++ b/iot/include/alibabacloud/iot/model/CreateDownloadDataJobRequest.h @@ -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. + */ + +#ifndef ALIBABACLOUD_IOT_MODEL_CREATEDOWNLOADDATAJOBREQUEST_H_ +#define ALIBABACLOUD_IOT_MODEL_CREATEDOWNLOADDATAJOBREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Iot + { + namespace Model + { + class ALIBABACLOUD_IOT_EXPORT CreateDownloadDataJobRequest : public RpcServiceRequest + { + + public: + CreateDownloadDataJobRequest(); + ~CreateDownloadDataJobRequest(); + + long getStartTime()const; + void setStartTime(long startTime); + std::string getFileConfig()const; + void setFileConfig(const std::string& fileConfig); + std::string getIotInstanceId()const; + void setIotInstanceId(const std::string& iotInstanceId); + std::string getContext()const; + void setContext(const std::string& context); + std::string getTableName()const; + void setTableName(const std::string& tableName); + long getEndTime()const; + void setEndTime(long endTime); + std::string getDownloadDataType()const; + void setDownloadDataType(const std::string& downloadDataType); + std::string getApiProduct()const; + void setApiProduct(const std::string& apiProduct); + std::string getApiRevision()const; + void setApiRevision(const std::string& apiRevision); + + private: + long startTime_; + std::string fileConfig_; + std::string iotInstanceId_; + std::string context_; + std::string tableName_; + long endTime_; + std::string downloadDataType_; + std::string apiProduct_; + std::string apiRevision_; + + }; + } + } +} +#endif // !ALIBABACLOUD_IOT_MODEL_CREATEDOWNLOADDATAJOBREQUEST_H_ \ No newline at end of file diff --git a/iot/include/alibabacloud/iot/model/CreateDownloadDataJobResult.h b/iot/include/alibabacloud/iot/model/CreateDownloadDataJobResult.h new file mode 100644 index 000000000..fc4722fb7 --- /dev/null +++ b/iot/include/alibabacloud/iot/model/CreateDownloadDataJobResult.h @@ -0,0 +1,105 @@ +/* + * 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_CREATEDOWNLOADDATAJOBRESULT_H_ +#define ALIBABACLOUD_IOT_MODEL_CREATEDOWNLOADDATAJOBRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Iot + { + namespace Model + { + class ALIBABACLOUD_IOT_EXPORT CreateDownloadDataJobResult : public ServiceResult + { + public: + struct Data + { + struct QuerySetting + { + struct SelectedHeadersItem + { + std::string geoClass; + std::string dimDateClass; + std::string alias; + std::string timeClass; + std::string fieldName; + std::string fieldType; + }; + struct AstExprItem + { + std::string expr; + std::string exprType; + }; + std::vector astExpr; + std::vector selectedHeaders; + }; + struct HeaderItem + { + std::string geoClass; + std::string dimDateClass; + std::string alias; + std::string typeClass; + std::string timeClass; + std::string dataPrecision; + std::string fieldName; + std::string fieldType; + }; + int status; + bool asyncExecute; + long endTime; + int pageSize; + std::string csvUrl; + long beginTime; + std::string csvFileName; + std::string datasetId; + long totalCount; + std::vector header; + std::string longJobId; + std::string resultDataInString; + int pageNo; + QuerySetting querySetting; + int previewSize; + }; + + + CreateDownloadDataJobResult(); + explicit CreateDownloadDataJobResult(const std::string &payload); + ~CreateDownloadDataJobResult(); + Data getData()const; + std::string getErrorMessage()const; + std::string getCode()const; + bool getSuccess()const; + + protected: + void parse(const std::string &payload); + private: + Data data_; + std::string errorMessage_; + std::string code_; + bool success_; + + }; + } + } +} +#endif // !ALIBABACLOUD_IOT_MODEL_CREATEDOWNLOADDATAJOBRESULT_H_ \ No newline at end of file diff --git a/iot/include/alibabacloud/iot/model/GetDownloadFileRequest.h b/iot/include/alibabacloud/iot/model/GetDownloadFileRequest.h new file mode 100644 index 000000000..09f62e407 --- /dev/null +++ b/iot/include/alibabacloud/iot/model/GetDownloadFileRequest.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_GETDOWNLOADFILEREQUEST_H_ +#define ALIBABACLOUD_IOT_MODEL_GETDOWNLOADFILEREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Iot + { + namespace Model + { + class ALIBABACLOUD_IOT_EXPORT GetDownloadFileRequest : public RpcServiceRequest + { + + public: + GetDownloadFileRequest(); + ~GetDownloadFileRequest(); + + std::string getIotInstanceId()const; + void setIotInstanceId(const std::string& iotInstanceId); + std::string getContext()const; + void setContext(const std::string& context); + std::string getLongJobId()const; + void setLongJobId(const std::string& longJobId); + std::string getApiProduct()const; + void setApiProduct(const std::string& apiProduct); + std::string getApiRevision()const; + void setApiRevision(const std::string& apiRevision); + + private: + std::string iotInstanceId_; + std::string context_; + std::string longJobId_; + std::string apiProduct_; + std::string apiRevision_; + + }; + } + } +} +#endif // !ALIBABACLOUD_IOT_MODEL_GETDOWNLOADFILEREQUEST_H_ \ No newline at end of file diff --git a/iot/include/alibabacloud/iot/model/GetDownloadFileResult.h b/iot/include/alibabacloud/iot/model/GetDownloadFileResult.h new file mode 100644 index 000000000..5dbbd9c9f --- /dev/null +++ b/iot/include/alibabacloud/iot/model/GetDownloadFileResult.h @@ -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. + */ + +#ifndef ALIBABACLOUD_IOT_MODEL_GETDOWNLOADFILERESULT_H_ +#define ALIBABACLOUD_IOT_MODEL_GETDOWNLOADFILERESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Iot + { + namespace Model + { + class ALIBABACLOUD_IOT_EXPORT GetDownloadFileResult : public ServiceResult + { + public: + struct Data + { + struct QuerySetting + { + struct SelectedHeadersItem + { + std::string geoClass; + std::string dimDateClass; + std::string alias; + std::string timeClass; + std::string fieldName; + std::string fieldType; + }; + struct AstExprItem + { + std::string expr; + std::string exprType; + }; + std::vector astExpr; + std::vector selectedHeaders; + }; + struct HeaderItem + { + std::string geoClass; + std::string dimDateClass; + std::string alias; + std::string typeClass; + std::string timeClass; + std::string fieldName; + std::string fieldType; + }; + int status; + bool asyncExecute; + long endTime; + int pageSize; + std::string csvUrl; + long beginTime; + std::string csvUrl1; + std::string csvFileName; + std::string datasetId; + std::vector result; + long totalCount; + std::vector header; + std::string longJobId; + std::string resultDataInString; + int pageNo; + QuerySetting querySetting; + int previewSize; + }; + + + GetDownloadFileResult(); + explicit GetDownloadFileResult(const std::string &payload); + ~GetDownloadFileResult(); + Data getData()const; + std::string getErrorMessage()const; + std::string getCode()const; + bool getSuccess()const; + + protected: + void parse(const std::string &payload); + private: + Data data_; + std::string errorMessage_; + std::string code_; + bool success_; + + }; + } + } +} +#endif // !ALIBABACLOUD_IOT_MODEL_GETDOWNLOADFILERESULT_H_ \ No newline at end of file diff --git a/iot/include/alibabacloud/iot/model/QueryDeviceSubTopicRequest.h b/iot/include/alibabacloud/iot/model/QueryDeviceSubTopicRequest.h new file mode 100644 index 000000000..5fbd9f471 --- /dev/null +++ b/iot/include/alibabacloud/iot/model/QueryDeviceSubTopicRequest.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_QUERYDEVICESUBTOPICREQUEST_H_ +#define ALIBABACLOUD_IOT_MODEL_QUERYDEVICESUBTOPICREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Iot + { + namespace Model + { + class ALIBABACLOUD_IOT_EXPORT QueryDeviceSubTopicRequest : public RpcServiceRequest + { + + public: + QueryDeviceSubTopicRequest(); + ~QueryDeviceSubTopicRequest(); + + std::string getIotInstanceId()const; + void setIotInstanceId(const std::string& iotInstanceId); + std::string getProductKey()const; + void setProductKey(const std::string& productKey); + std::string getApiProduct()const; + void setApiProduct(const std::string& apiProduct); + std::string getApiRevision()const; + void setApiRevision(const std::string& apiRevision); + std::string getDeviceName()const; + void setDeviceName(const std::string& deviceName); + + private: + std::string iotInstanceId_; + std::string productKey_; + std::string apiProduct_; + std::string apiRevision_; + std::string deviceName_; + + }; + } + } +} +#endif // !ALIBABACLOUD_IOT_MODEL_QUERYDEVICESUBTOPICREQUEST_H_ \ No newline at end of file diff --git a/iot/include/alibabacloud/iot/model/QueryDeviceSubTopicResult.h b/iot/include/alibabacloud/iot/model/QueryDeviceSubTopicResult.h new file mode 100644 index 000000000..ecae4bc39 --- /dev/null +++ b/iot/include/alibabacloud/iot/model/QueryDeviceSubTopicResult.h @@ -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. + */ + +#ifndef ALIBABACLOUD_IOT_MODEL_QUERYDEVICESUBTOPICRESULT_H_ +#define ALIBABACLOUD_IOT_MODEL_QUERYDEVICESUBTOPICRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Iot + { + namespace Model + { + class ALIBABACLOUD_IOT_EXPORT QueryDeviceSubTopicResult : public ServiceResult + { + public: + struct Topic + { + long timestamp; + std::string topicName; + }; + + + QueryDeviceSubTopicResult(); + explicit QueryDeviceSubTopicResult(const std::string &payload); + ~QueryDeviceSubTopicResult(); + std::vector getTopicList()const; + std::string getErrorMessage()const; + std::string getCode()const; + bool getSuccess()const; + + protected: + void parse(const std::string &payload); + private: + std::vector topicList_; + std::string errorMessage_; + std::string code_; + bool success_; + + }; + } + } +} +#endif // !ALIBABACLOUD_IOT_MODEL_QUERYDEVICESUBTOPICRESULT_H_ \ No newline at end of file diff --git a/iot/src/IotClient.cc b/iot/src/IotClient.cc index 3a1d18eee..a00cf86d7 100644 --- a/iot/src/IotClient.cc +++ b/iot/src/IotClient.cc @@ -2283,6 +2283,42 @@ IotClient::CreateDeviceTunnelOutcomeCallable IotClient::createDeviceTunnelCallab return task->get_future(); } +IotClient::CreateDownloadDataJobOutcome IotClient::createDownloadDataJob(const CreateDownloadDataJobRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return CreateDownloadDataJobOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return CreateDownloadDataJobOutcome(CreateDownloadDataJobResult(outcome.result())); + else + return CreateDownloadDataJobOutcome(outcome.error()); +} + +void IotClient::createDownloadDataJobAsync(const CreateDownloadDataJobRequest& request, const CreateDownloadDataJobAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, createDownloadDataJob(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +IotClient::CreateDownloadDataJobOutcomeCallable IotClient::createDownloadDataJobCallable(const CreateDownloadDataJobRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->createDownloadDataJob(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + IotClient::CreateEdgeDriverOutcome IotClient::createEdgeDriver(const CreateEdgeDriverRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); @@ -5487,6 +5523,42 @@ IotClient::GetDeviceTunnelStatusOutcomeCallable IotClient::getDeviceTunnelStatus return task->get_future(); } +IotClient::GetDownloadFileOutcome IotClient::getDownloadFile(const GetDownloadFileRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return GetDownloadFileOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return GetDownloadFileOutcome(GetDownloadFileResult(outcome.result())); + else + return GetDownloadFileOutcome(outcome.error()); +} + +void IotClient::getDownloadFileAsync(const GetDownloadFileRequest& request, const GetDownloadFileAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, getDownloadFile(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +IotClient::GetDownloadFileOutcomeCallable IotClient::getDownloadFileCallable(const GetDownloadFileRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->getDownloadFile(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + IotClient::GetEdgeDriverVersionOutcome IotClient::getEdgeDriverVersion(const GetEdgeDriverVersionRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); @@ -9051,6 +9123,42 @@ IotClient::QueryDeviceStatisticsOutcomeCallable IotClient::queryDeviceStatistics return task->get_future(); } +IotClient::QueryDeviceSubTopicOutcome IotClient::queryDeviceSubTopic(const QueryDeviceSubTopicRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return QueryDeviceSubTopicOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return QueryDeviceSubTopicOutcome(QueryDeviceSubTopicResult(outcome.result())); + else + return QueryDeviceSubTopicOutcome(outcome.error()); +} + +void IotClient::queryDeviceSubTopicAsync(const QueryDeviceSubTopicRequest& request, const QueryDeviceSubTopicAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, queryDeviceSubTopic(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +IotClient::QueryDeviceSubTopicOutcomeCallable IotClient::queryDeviceSubTopicCallable(const QueryDeviceSubTopicRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->queryDeviceSubTopic(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + IotClient::QueryDeviceTunnelOutcome IotClient::queryDeviceTunnel(const QueryDeviceTunnelRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); diff --git a/iot/src/model/CreateDownloadDataJobRequest.cc b/iot/src/model/CreateDownloadDataJobRequest.cc new file mode 100644 index 000000000..c0eca91db --- /dev/null +++ b/iot/src/model/CreateDownloadDataJobRequest.cc @@ -0,0 +1,128 @@ +/* + * 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::CreateDownloadDataJobRequest; + +CreateDownloadDataJobRequest::CreateDownloadDataJobRequest() : + RpcServiceRequest("iot", "2018-01-20", "CreateDownloadDataJob") +{ + setMethod(HttpRequest::Method::Post); +} + +CreateDownloadDataJobRequest::~CreateDownloadDataJobRequest() +{} + +long CreateDownloadDataJobRequest::getStartTime()const +{ + return startTime_; +} + +void CreateDownloadDataJobRequest::setStartTime(long startTime) +{ + startTime_ = startTime; + setParameter("StartTime", std::to_string(startTime)); +} + +std::string CreateDownloadDataJobRequest::getFileConfig()const +{ + return fileConfig_; +} + +void CreateDownloadDataJobRequest::setFileConfig(const std::string& fileConfig) +{ + fileConfig_ = fileConfig; + setParameter("FileConfig", fileConfig); +} + +std::string CreateDownloadDataJobRequest::getIotInstanceId()const +{ + return iotInstanceId_; +} + +void CreateDownloadDataJobRequest::setIotInstanceId(const std::string& iotInstanceId) +{ + iotInstanceId_ = iotInstanceId; + setBodyParameter("IotInstanceId", iotInstanceId); +} + +std::string CreateDownloadDataJobRequest::getContext()const +{ + return context_; +} + +void CreateDownloadDataJobRequest::setContext(const std::string& context) +{ + context_ = context; + setBodyParameter("Context", context); +} + +std::string CreateDownloadDataJobRequest::getTableName()const +{ + return tableName_; +} + +void CreateDownloadDataJobRequest::setTableName(const std::string& tableName) +{ + tableName_ = tableName; + setParameter("TableName", tableName); +} + +long CreateDownloadDataJobRequest::getEndTime()const +{ + return endTime_; +} + +void CreateDownloadDataJobRequest::setEndTime(long endTime) +{ + endTime_ = endTime; + setParameter("EndTime", std::to_string(endTime)); +} + +std::string CreateDownloadDataJobRequest::getDownloadDataType()const +{ + return downloadDataType_; +} + +void CreateDownloadDataJobRequest::setDownloadDataType(const std::string& downloadDataType) +{ + downloadDataType_ = downloadDataType; + setParameter("DownloadDataType", downloadDataType); +} + +std::string CreateDownloadDataJobRequest::getApiProduct()const +{ + return apiProduct_; +} + +void CreateDownloadDataJobRequest::setApiProduct(const std::string& apiProduct) +{ + apiProduct_ = apiProduct; + setBodyParameter("ApiProduct", apiProduct); +} + +std::string CreateDownloadDataJobRequest::getApiRevision()const +{ + return apiRevision_; +} + +void CreateDownloadDataJobRequest::setApiRevision(const std::string& apiRevision) +{ + apiRevision_ = apiRevision; + setBodyParameter("ApiRevision", apiRevision); +} + diff --git a/iot/src/model/CreateDownloadDataJobResult.cc b/iot/src/model/CreateDownloadDataJobResult.cc new file mode 100644 index 000000000..e885ad04e --- /dev/null +++ b/iot/src/model/CreateDownloadDataJobResult.cc @@ -0,0 +1,148 @@ +/* + * 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; + +CreateDownloadDataJobResult::CreateDownloadDataJobResult() : + ServiceResult() +{} + +CreateDownloadDataJobResult::CreateDownloadDataJobResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +CreateDownloadDataJobResult::~CreateDownloadDataJobResult() +{} + +void CreateDownloadDataJobResult::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["PreviewSize"].isNull()) + data_.previewSize = std::stoi(dataNode["PreviewSize"].asString()); + if(!dataNode["CsvUrl"].isNull()) + data_.csvUrl = dataNode["CsvUrl"].asString(); + if(!dataNode["DatasetId"].isNull()) + data_.datasetId = dataNode["DatasetId"].asString(); + if(!dataNode["LongJobId"].isNull()) + data_.longJobId = dataNode["LongJobId"].asString(); + if(!dataNode["Status"].isNull()) + data_.status = std::stoi(dataNode["Status"].asString()); + if(!dataNode["BeginTime"].isNull()) + data_.beginTime = std::stol(dataNode["BeginTime"].asString()); + if(!dataNode["EndTime"].isNull()) + data_.endTime = std::stol(dataNode["EndTime"].asString()); + if(!dataNode["ResultDataInString"].isNull()) + data_.resultDataInString = dataNode["ResultDataInString"].asString(); + if(!dataNode["AsyncExecute"].isNull()) + data_.asyncExecute = dataNode["AsyncExecute"].asString() == "true"; + if(!dataNode["TotalCount"].isNull()) + data_.totalCount = std::stol(dataNode["TotalCount"].asString()); + if(!dataNode["PageNo"].isNull()) + data_.pageNo = std::stoi(dataNode["PageNo"].asString()); + if(!dataNode["PageSize"].isNull()) + data_.pageSize = std::stoi(dataNode["PageSize"].asString()); + if(!dataNode["CsvFileName"].isNull()) + data_.csvFileName = dataNode["CsvFileName"].asString(); + auto allHeaderNode = dataNode["Header"]["HeaderItem"]; + for (auto dataNodeHeaderHeaderItem : allHeaderNode) + { + Data::HeaderItem headerItemObject; + if(!dataNodeHeaderHeaderItem["FieldName"].isNull()) + headerItemObject.fieldName = dataNodeHeaderHeaderItem["FieldName"].asString(); + if(!dataNodeHeaderHeaderItem["Alias"].isNull()) + headerItemObject.alias = dataNodeHeaderHeaderItem["Alias"].asString(); + if(!dataNodeHeaderHeaderItem["FieldType"].isNull()) + headerItemObject.fieldType = dataNodeHeaderHeaderItem["FieldType"].asString(); + if(!dataNodeHeaderHeaderItem["TypeClass"].isNull()) + headerItemObject.typeClass = dataNodeHeaderHeaderItem["TypeClass"].asString(); + if(!dataNodeHeaderHeaderItem["TimeClass"].isNull()) + headerItemObject.timeClass = dataNodeHeaderHeaderItem["TimeClass"].asString(); + if(!dataNodeHeaderHeaderItem["GeoClass"].isNull()) + headerItemObject.geoClass = dataNodeHeaderHeaderItem["GeoClass"].asString(); + if(!dataNodeHeaderHeaderItem["DimDateClass"].isNull()) + headerItemObject.dimDateClass = dataNodeHeaderHeaderItem["DimDateClass"].asString(); + if(!dataNodeHeaderHeaderItem["DataPrecision"].isNull()) + headerItemObject.dataPrecision = dataNodeHeaderHeaderItem["DataPrecision"].asString(); + data_.header.push_back(headerItemObject); + } + auto querySettingNode = dataNode["QuerySetting"]; + auto allSelectedHeadersNode = querySettingNode["SelectedHeaders"]["SelectedHeadersItem"]; + for (auto querySettingNodeSelectedHeadersSelectedHeadersItem : allSelectedHeadersNode) + { + Data::QuerySetting::SelectedHeadersItem selectedHeadersItemObject; + if(!querySettingNodeSelectedHeadersSelectedHeadersItem["FieldName"].isNull()) + selectedHeadersItemObject.fieldName = querySettingNodeSelectedHeadersSelectedHeadersItem["FieldName"].asString(); + if(!querySettingNodeSelectedHeadersSelectedHeadersItem["Alias"].isNull()) + selectedHeadersItemObject.alias = querySettingNodeSelectedHeadersSelectedHeadersItem["Alias"].asString(); + if(!querySettingNodeSelectedHeadersSelectedHeadersItem["FieldType"].isNull()) + selectedHeadersItemObject.fieldType = querySettingNodeSelectedHeadersSelectedHeadersItem["FieldType"].asString(); + if(!querySettingNodeSelectedHeadersSelectedHeadersItem["TimeClass"].isNull()) + selectedHeadersItemObject.timeClass = querySettingNodeSelectedHeadersSelectedHeadersItem["TimeClass"].asString(); + if(!querySettingNodeSelectedHeadersSelectedHeadersItem["GeoClass"].isNull()) + selectedHeadersItemObject.geoClass = querySettingNodeSelectedHeadersSelectedHeadersItem["GeoClass"].asString(); + if(!querySettingNodeSelectedHeadersSelectedHeadersItem["DimDateClass"].isNull()) + selectedHeadersItemObject.dimDateClass = querySettingNodeSelectedHeadersSelectedHeadersItem["DimDateClass"].asString(); + data_.querySetting.selectedHeaders.push_back(selectedHeadersItemObject); + } + auto allAstExprNode = querySettingNode["AstExpr"]["AstExprItem"]; + for (auto querySettingNodeAstExprAstExprItem : allAstExprNode) + { + Data::QuerySetting::AstExprItem astExprItemObject; + if(!querySettingNodeAstExprAstExprItem["Expr"].isNull()) + astExprItemObject.expr = querySettingNodeAstExprAstExprItem["Expr"].asString(); + if(!querySettingNodeAstExprAstExprItem["ExprType"].isNull()) + astExprItemObject.exprType = querySettingNodeAstExprAstExprItem["ExprType"].asString(); + data_.querySetting.astExpr.push_back(astExprItemObject); + } + 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(); + +} + +CreateDownloadDataJobResult::Data CreateDownloadDataJobResult::getData()const +{ + return data_; +} + +std::string CreateDownloadDataJobResult::getErrorMessage()const +{ + return errorMessage_; +} + +std::string CreateDownloadDataJobResult::getCode()const +{ + return code_; +} + +bool CreateDownloadDataJobResult::getSuccess()const +{ + return success_; +} + diff --git a/iot/src/model/GetDownloadFileRequest.cc b/iot/src/model/GetDownloadFileRequest.cc new file mode 100644 index 000000000..ee397013a --- /dev/null +++ b/iot/src/model/GetDownloadFileRequest.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::GetDownloadFileRequest; + +GetDownloadFileRequest::GetDownloadFileRequest() : + RpcServiceRequest("iot", "2018-01-20", "GetDownloadFile") +{ + setMethod(HttpRequest::Method::Post); +} + +GetDownloadFileRequest::~GetDownloadFileRequest() +{} + +std::string GetDownloadFileRequest::getIotInstanceId()const +{ + return iotInstanceId_; +} + +void GetDownloadFileRequest::setIotInstanceId(const std::string& iotInstanceId) +{ + iotInstanceId_ = iotInstanceId; + setBodyParameter("IotInstanceId", iotInstanceId); +} + +std::string GetDownloadFileRequest::getContext()const +{ + return context_; +} + +void GetDownloadFileRequest::setContext(const std::string& context) +{ + context_ = context; + setBodyParameter("Context", context); +} + +std::string GetDownloadFileRequest::getLongJobId()const +{ + return longJobId_; +} + +void GetDownloadFileRequest::setLongJobId(const std::string& longJobId) +{ + longJobId_ = longJobId; + setParameter("LongJobId", longJobId); +} + +std::string GetDownloadFileRequest::getApiProduct()const +{ + return apiProduct_; +} + +void GetDownloadFileRequest::setApiProduct(const std::string& apiProduct) +{ + apiProduct_ = apiProduct; + setBodyParameter("ApiProduct", apiProduct); +} + +std::string GetDownloadFileRequest::getApiRevision()const +{ + return apiRevision_; +} + +void GetDownloadFileRequest::setApiRevision(const std::string& apiRevision) +{ + apiRevision_ = apiRevision; + setBodyParameter("ApiRevision", apiRevision); +} + diff --git a/iot/src/model/GetDownloadFileResult.cc b/iot/src/model/GetDownloadFileResult.cc new file mode 100644 index 000000000..bee21a9de --- /dev/null +++ b/iot/src/model/GetDownloadFileResult.cc @@ -0,0 +1,151 @@ +/* + * 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; + +GetDownloadFileResult::GetDownloadFileResult() : + ServiceResult() +{} + +GetDownloadFileResult::GetDownloadFileResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +GetDownloadFileResult::~GetDownloadFileResult() +{} + +void GetDownloadFileResult::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["PreviewSize"].isNull()) + data_.previewSize = std::stoi(dataNode["PreviewSize"].asString()); + if(!dataNode["CsvUrl"].isNull()) + data_.csvUrl = dataNode["CsvUrl"].asString(); + if(!dataNode["DatasetId"].isNull()) + data_.datasetId = dataNode["DatasetId"].asString(); + if(!dataNode["LongJobId"].isNull()) + data_.longJobId = dataNode["LongJobId"].asString(); + if(!dataNode["Status"].isNull()) + data_.status = std::stoi(dataNode["Status"].asString()); + if(!dataNode["BeginTime"].isNull()) + data_.beginTime = std::stol(dataNode["BeginTime"].asString()); + if(!dataNode["EndTime"].isNull()) + data_.endTime = std::stol(dataNode["EndTime"].asString()); + if(!dataNode["ResultDataInString"].isNull()) + data_.resultDataInString = dataNode["ResultDataInString"].asString(); + if(!dataNode["AsyncExecute"].isNull()) + data_.asyncExecute = dataNode["AsyncExecute"].asString() == "true"; + if(!dataNode["TotalCount"].isNull()) + data_.totalCount = std::stol(dataNode["TotalCount"].asString()); + if(!dataNode["PageNo"].isNull()) + data_.pageNo = std::stoi(dataNode["PageNo"].asString()); + if(!dataNode["PageSize"].isNull()) + data_.pageSize = std::stoi(dataNode["PageSize"].asString()); + if(!dataNode["CsvUrl"].isNull()) + data_.csvUrl1 = dataNode["CsvUrl"].asString(); + if(!dataNode["CsvFileName"].isNull()) + data_.csvFileName = dataNode["CsvFileName"].asString(); + auto allHeaderNode = dataNode["Header"]["HeaderItem"]; + for (auto dataNodeHeaderHeaderItem : allHeaderNode) + { + Data::HeaderItem headerItemObject; + if(!dataNodeHeaderHeaderItem["FieldName"].isNull()) + headerItemObject.fieldName = dataNodeHeaderHeaderItem["FieldName"].asString(); + if(!dataNodeHeaderHeaderItem["Alias"].isNull()) + headerItemObject.alias = dataNodeHeaderHeaderItem["Alias"].asString(); + if(!dataNodeHeaderHeaderItem["FieldType"].isNull()) + headerItemObject.fieldType = dataNodeHeaderHeaderItem["FieldType"].asString(); + if(!dataNodeHeaderHeaderItem["TypeClass"].isNull()) + headerItemObject.typeClass = dataNodeHeaderHeaderItem["TypeClass"].asString(); + if(!dataNodeHeaderHeaderItem["TimeClass"].isNull()) + headerItemObject.timeClass = dataNodeHeaderHeaderItem["TimeClass"].asString(); + if(!dataNodeHeaderHeaderItem["GeoClass"].isNull()) + headerItemObject.geoClass = dataNodeHeaderHeaderItem["GeoClass"].asString(); + if(!dataNodeHeaderHeaderItem["DimDateClass"].isNull()) + headerItemObject.dimDateClass = dataNodeHeaderHeaderItem["DimDateClass"].asString(); + data_.header.push_back(headerItemObject); + } + auto querySettingNode = dataNode["QuerySetting"]; + auto allSelectedHeadersNode = querySettingNode["SelectedHeaders"]["SelectedHeadersItem"]; + for (auto querySettingNodeSelectedHeadersSelectedHeadersItem : allSelectedHeadersNode) + { + Data::QuerySetting::SelectedHeadersItem selectedHeadersItemObject; + if(!querySettingNodeSelectedHeadersSelectedHeadersItem["FieldName"].isNull()) + selectedHeadersItemObject.fieldName = querySettingNodeSelectedHeadersSelectedHeadersItem["FieldName"].asString(); + if(!querySettingNodeSelectedHeadersSelectedHeadersItem["Alias"].isNull()) + selectedHeadersItemObject.alias = querySettingNodeSelectedHeadersSelectedHeadersItem["Alias"].asString(); + if(!querySettingNodeSelectedHeadersSelectedHeadersItem["FieldType"].isNull()) + selectedHeadersItemObject.fieldType = querySettingNodeSelectedHeadersSelectedHeadersItem["FieldType"].asString(); + if(!querySettingNodeSelectedHeadersSelectedHeadersItem["TimeClass"].isNull()) + selectedHeadersItemObject.timeClass = querySettingNodeSelectedHeadersSelectedHeadersItem["TimeClass"].asString(); + if(!querySettingNodeSelectedHeadersSelectedHeadersItem["GeoClass"].isNull()) + selectedHeadersItemObject.geoClass = querySettingNodeSelectedHeadersSelectedHeadersItem["GeoClass"].asString(); + if(!querySettingNodeSelectedHeadersSelectedHeadersItem["DimDateClass"].isNull()) + selectedHeadersItemObject.dimDateClass = querySettingNodeSelectedHeadersSelectedHeadersItem["DimDateClass"].asString(); + data_.querySetting.selectedHeaders.push_back(selectedHeadersItemObject); + } + auto allAstExprNode = querySettingNode["AstExpr"]["AstExprItem"]; + for (auto querySettingNodeAstExprAstExprItem : allAstExprNode) + { + Data::QuerySetting::AstExprItem astExprItemObject; + if(!querySettingNodeAstExprAstExprItem["Expr"].isNull()) + astExprItemObject.expr = querySettingNodeAstExprAstExprItem["Expr"].asString(); + if(!querySettingNodeAstExprAstExprItem["ExprType"].isNull()) + astExprItemObject.exprType = querySettingNodeAstExprAstExprItem["ExprType"].asString(); + data_.querySetting.astExpr.push_back(astExprItemObject); + } + auto allResult = dataNode["Result"]["Result"]; + for (auto value : allResult) + data_.result.push_back(value.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(); + +} + +GetDownloadFileResult::Data GetDownloadFileResult::getData()const +{ + return data_; +} + +std::string GetDownloadFileResult::getErrorMessage()const +{ + return errorMessage_; +} + +std::string GetDownloadFileResult::getCode()const +{ + return code_; +} + +bool GetDownloadFileResult::getSuccess()const +{ + return success_; +} + diff --git a/iot/src/model/QueryDeviceSubTopicRequest.cc b/iot/src/model/QueryDeviceSubTopicRequest.cc new file mode 100644 index 000000000..4643eb993 --- /dev/null +++ b/iot/src/model/QueryDeviceSubTopicRequest.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::QueryDeviceSubTopicRequest; + +QueryDeviceSubTopicRequest::QueryDeviceSubTopicRequest() : + RpcServiceRequest("iot", "2018-01-20", "QueryDeviceSubTopic") +{ + setMethod(HttpRequest::Method::Post); +} + +QueryDeviceSubTopicRequest::~QueryDeviceSubTopicRequest() +{} + +std::string QueryDeviceSubTopicRequest::getIotInstanceId()const +{ + return iotInstanceId_; +} + +void QueryDeviceSubTopicRequest::setIotInstanceId(const std::string& iotInstanceId) +{ + iotInstanceId_ = iotInstanceId; + setParameter("IotInstanceId", iotInstanceId); +} + +std::string QueryDeviceSubTopicRequest::getProductKey()const +{ + return productKey_; +} + +void QueryDeviceSubTopicRequest::setProductKey(const std::string& productKey) +{ + productKey_ = productKey; + setParameter("ProductKey", productKey); +} + +std::string QueryDeviceSubTopicRequest::getApiProduct()const +{ + return apiProduct_; +} + +void QueryDeviceSubTopicRequest::setApiProduct(const std::string& apiProduct) +{ + apiProduct_ = apiProduct; + setBodyParameter("ApiProduct", apiProduct); +} + +std::string QueryDeviceSubTopicRequest::getApiRevision()const +{ + return apiRevision_; +} + +void QueryDeviceSubTopicRequest::setApiRevision(const std::string& apiRevision) +{ + apiRevision_ = apiRevision; + setBodyParameter("ApiRevision", apiRevision); +} + +std::string QueryDeviceSubTopicRequest::getDeviceName()const +{ + return deviceName_; +} + +void QueryDeviceSubTopicRequest::setDeviceName(const std::string& deviceName) +{ + deviceName_ = deviceName; + setParameter("DeviceName", deviceName); +} + diff --git a/iot/src/model/QueryDeviceSubTopicResult.cc b/iot/src/model/QueryDeviceSubTopicResult.cc new file mode 100644 index 000000000..1959ed73f --- /dev/null +++ b/iot/src/model/QueryDeviceSubTopicResult.cc @@ -0,0 +1,80 @@ +/* + * 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; + +QueryDeviceSubTopicResult::QueryDeviceSubTopicResult() : + ServiceResult() +{} + +QueryDeviceSubTopicResult::QueryDeviceSubTopicResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +QueryDeviceSubTopicResult::~QueryDeviceSubTopicResult() +{} + +void QueryDeviceSubTopicResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto allTopicListNode = value["TopicList"]["topic"]; + for (auto valueTopicListtopic : allTopicListNode) + { + Topic topicListObject; + if(!valueTopicListtopic["TopicName"].isNull()) + topicListObject.topicName = valueTopicListtopic["TopicName"].asString(); + if(!valueTopicListtopic["Timestamp"].isNull()) + topicListObject.timestamp = std::stol(valueTopicListtopic["Timestamp"].asString()); + topicList_.push_back(topicListObject); + } + 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 QueryDeviceSubTopicResult::getTopicList()const +{ + return topicList_; +} + +std::string QueryDeviceSubTopicResult::getErrorMessage()const +{ + return errorMessage_; +} + +std::string QueryDeviceSubTopicResult::getCode()const +{ + return code_; +} + +bool QueryDeviceSubTopicResult::getSuccess()const +{ + return success_; +} +