From 5b44f9773d29dd4622516a16a7dc68a7814fed8c Mon Sep 17 00:00:00 2001 From: sdk-team Date: Tue, 3 Jan 2023 08:07:55 +0000 Subject: [PATCH] Pub Support MessageExpiryInterval and Retained. --- VERSION | 2 +- iot/CMakeLists.txt | 12 ++ iot/include/alibabacloud/iot/IotClient.h | 24 ++++ .../model/BatchCheckVehicleDeviceRequest.h | 70 +++++++++++ .../iot/model/BatchCheckVehicleDeviceResult.h | 64 ++++++++++ .../model/BatchImportVehicleDeviceRequest.h | 70 +++++++++++ .../model/BatchImportVehicleDeviceResult.h | 61 +++++++++ .../alibabacloud/iot/model/PubRequest.h | 6 + .../iot/model/QueryVehicleDeviceRequest.h | 69 +++++++++++ .../iot/model/QueryVehicleDeviceResult.h | 75 +++++++++++ .../alibabacloud/iot/model/RRpcRequest.h | 3 + iot/src/IotClient.cc | 108 ++++++++++++++++ .../model/BatchCheckVehicleDeviceRequest.cc | 101 +++++++++++++++ .../model/BatchCheckVehicleDeviceResult.cc | 83 +++++++++++++ .../model/BatchImportVehicleDeviceRequest.cc | 101 +++++++++++++++ .../model/BatchImportVehicleDeviceResult.cc | 73 +++++++++++ iot/src/model/PubRequest.cc | 22 ++++ iot/src/model/QueryVehicleDeviceRequest.cc | 117 ++++++++++++++++++ iot/src/model/QueryVehicleDeviceResult.cc | 101 +++++++++++++++ iot/src/model/RRpcRequest.cc | 11 ++ 20 files changed, 1172 insertions(+), 1 deletion(-) create mode 100644 iot/include/alibabacloud/iot/model/BatchCheckVehicleDeviceRequest.h create mode 100644 iot/include/alibabacloud/iot/model/BatchCheckVehicleDeviceResult.h create mode 100644 iot/include/alibabacloud/iot/model/BatchImportVehicleDeviceRequest.h create mode 100644 iot/include/alibabacloud/iot/model/BatchImportVehicleDeviceResult.h create mode 100644 iot/include/alibabacloud/iot/model/QueryVehicleDeviceRequest.h create mode 100644 iot/include/alibabacloud/iot/model/QueryVehicleDeviceResult.h create mode 100644 iot/src/model/BatchCheckVehicleDeviceRequest.cc create mode 100644 iot/src/model/BatchCheckVehicleDeviceResult.cc create mode 100644 iot/src/model/BatchImportVehicleDeviceRequest.cc create mode 100644 iot/src/model/BatchImportVehicleDeviceResult.cc create mode 100644 iot/src/model/QueryVehicleDeviceRequest.cc create mode 100644 iot/src/model/QueryVehicleDeviceResult.cc diff --git a/VERSION b/VERSION index edc2330c9..c536c7158 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.1408 \ No newline at end of file +1.36.1409 \ No newline at end of file diff --git a/iot/CMakeLists.txt b/iot/CMakeLists.txt index bfe1ce114..fa27de7a2 100644 --- a/iot/CMakeLists.txt +++ b/iot/CMakeLists.txt @@ -45,6 +45,8 @@ set(iot_public_header_model include/alibabacloud/iot/model/BatchCheckDeviceNamesResult.h include/alibabacloud/iot/model/BatchCheckImportDeviceRequest.h include/alibabacloud/iot/model/BatchCheckImportDeviceResult.h + include/alibabacloud/iot/model/BatchCheckVehicleDeviceRequest.h + include/alibabacloud/iot/model/BatchCheckVehicleDeviceResult.h include/alibabacloud/iot/model/BatchClearEdgeInstanceDeviceConfigRequest.h include/alibabacloud/iot/model/BatchClearEdgeInstanceDeviceConfigResult.h include/alibabacloud/iot/model/BatchCreateSoundCodeLabelRequest.h @@ -73,6 +75,8 @@ set(iot_public_header_model include/alibabacloud/iot/model/BatchGetEdgeInstanceDriverConfigsResult.h include/alibabacloud/iot/model/BatchImportDeviceRequest.h include/alibabacloud/iot/model/BatchImportDeviceResult.h + include/alibabacloud/iot/model/BatchImportVehicleDeviceRequest.h + include/alibabacloud/iot/model/BatchImportVehicleDeviceResult.h include/alibabacloud/iot/model/BatchPubRequest.h include/alibabacloud/iot/model/BatchPubResult.h include/alibabacloud/iot/model/BatchQueryDeviceDetailRequest.h @@ -661,6 +665,8 @@ set(iot_public_header_model include/alibabacloud/iot/model/QueryTopicReverseRouteTableResult.h include/alibabacloud/iot/model/QueryTopicRouteTableRequest.h include/alibabacloud/iot/model/QueryTopicRouteTableResult.h + include/alibabacloud/iot/model/QueryVehicleDeviceRequest.h + include/alibabacloud/iot/model/QueryVehicleDeviceResult.h include/alibabacloud/iot/model/RRpcRequest.h include/alibabacloud/iot/model/RRpcResult.h include/alibabacloud/iot/model/ReBindLicenseDeviceRequest.h @@ -830,6 +836,8 @@ set(iot_src src/model/BatchCheckDeviceNamesResult.cc src/model/BatchCheckImportDeviceRequest.cc src/model/BatchCheckImportDeviceResult.cc + src/model/BatchCheckVehicleDeviceRequest.cc + src/model/BatchCheckVehicleDeviceResult.cc src/model/BatchClearEdgeInstanceDeviceConfigRequest.cc src/model/BatchClearEdgeInstanceDeviceConfigResult.cc src/model/BatchCreateSoundCodeLabelRequest.cc @@ -858,6 +866,8 @@ set(iot_src src/model/BatchGetEdgeInstanceDriverConfigsResult.cc src/model/BatchImportDeviceRequest.cc src/model/BatchImportDeviceResult.cc + src/model/BatchImportVehicleDeviceRequest.cc + src/model/BatchImportVehicleDeviceResult.cc src/model/BatchPubRequest.cc src/model/BatchPubResult.cc src/model/BatchQueryDeviceDetailRequest.cc @@ -1446,6 +1456,8 @@ set(iot_src src/model/QueryTopicReverseRouteTableResult.cc src/model/QueryTopicRouteTableRequest.cc src/model/QueryTopicRouteTableResult.cc + src/model/QueryVehicleDeviceRequest.cc + src/model/QueryVehicleDeviceResult.cc src/model/RRpcRequest.cc src/model/RRpcResult.cc src/model/ReBindLicenseDeviceRequest.cc diff --git a/iot/include/alibabacloud/iot/IotClient.h b/iot/include/alibabacloud/iot/IotClient.h index 6cfb6c907..21054bcb0 100644 --- a/iot/include/alibabacloud/iot/IotClient.h +++ b/iot/include/alibabacloud/iot/IotClient.h @@ -46,6 +46,8 @@ #include "model/BatchCheckDeviceNamesResult.h" #include "model/BatchCheckImportDeviceRequest.h" #include "model/BatchCheckImportDeviceResult.h" +#include "model/BatchCheckVehicleDeviceRequest.h" +#include "model/BatchCheckVehicleDeviceResult.h" #include "model/BatchClearEdgeInstanceDeviceConfigRequest.h" #include "model/BatchClearEdgeInstanceDeviceConfigResult.h" #include "model/BatchCreateSoundCodeLabelRequest.h" @@ -74,6 +76,8 @@ #include "model/BatchGetEdgeInstanceDriverConfigsResult.h" #include "model/BatchImportDeviceRequest.h" #include "model/BatchImportDeviceResult.h" +#include "model/BatchImportVehicleDeviceRequest.h" +#include "model/BatchImportVehicleDeviceResult.h" #include "model/BatchPubRequest.h" #include "model/BatchPubResult.h" #include "model/BatchQueryDeviceDetailRequest.h" @@ -662,6 +666,8 @@ #include "model/QueryTopicReverseRouteTableResult.h" #include "model/QueryTopicRouteTableRequest.h" #include "model/QueryTopicRouteTableResult.h" +#include "model/QueryVehicleDeviceRequest.h" +#include "model/QueryVehicleDeviceResult.h" #include "model/RRpcRequest.h" #include "model/RRpcResult.h" #include "model/ReBindLicenseDeviceRequest.h" @@ -849,6 +855,9 @@ namespace AlibabaCloud typedef Outcome BatchCheckImportDeviceOutcome; typedef std::future BatchCheckImportDeviceOutcomeCallable; typedef std::function&)> BatchCheckImportDeviceAsyncHandler; + typedef Outcome BatchCheckVehicleDeviceOutcome; + typedef std::future BatchCheckVehicleDeviceOutcomeCallable; + typedef std::function&)> BatchCheckVehicleDeviceAsyncHandler; typedef Outcome BatchClearEdgeInstanceDeviceConfigOutcome; typedef std::future BatchClearEdgeInstanceDeviceConfigOutcomeCallable; typedef std::function&)> BatchClearEdgeInstanceDeviceConfigAsyncHandler; @@ -891,6 +900,9 @@ namespace AlibabaCloud typedef Outcome BatchImportDeviceOutcome; typedef std::future BatchImportDeviceOutcomeCallable; typedef std::function&)> BatchImportDeviceAsyncHandler; + typedef Outcome BatchImportVehicleDeviceOutcome; + typedef std::future BatchImportVehicleDeviceOutcomeCallable; + typedef std::function&)> BatchImportVehicleDeviceAsyncHandler; typedef Outcome BatchPubOutcome; typedef std::future BatchPubOutcomeCallable; typedef std::function&)> BatchPubAsyncHandler; @@ -1773,6 +1785,9 @@ namespace AlibabaCloud typedef Outcome QueryTopicRouteTableOutcome; typedef std::future QueryTopicRouteTableOutcomeCallable; typedef std::function&)> QueryTopicRouteTableAsyncHandler; + typedef Outcome QueryVehicleDeviceOutcome; + typedef std::future QueryVehicleDeviceOutcomeCallable; + typedef std::function&)> QueryVehicleDeviceAsyncHandler; typedef Outcome RRpcOutcome; typedef std::future RRpcOutcomeCallable; typedef std::function&)> RRpcAsyncHandler; @@ -2027,6 +2042,9 @@ namespace AlibabaCloud BatchCheckImportDeviceOutcome batchCheckImportDevice(const Model::BatchCheckImportDeviceRequest &request)const; void batchCheckImportDeviceAsync(const Model::BatchCheckImportDeviceRequest& request, const BatchCheckImportDeviceAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; BatchCheckImportDeviceOutcomeCallable batchCheckImportDeviceCallable(const Model::BatchCheckImportDeviceRequest& request) const; + BatchCheckVehicleDeviceOutcome batchCheckVehicleDevice(const Model::BatchCheckVehicleDeviceRequest &request)const; + void batchCheckVehicleDeviceAsync(const Model::BatchCheckVehicleDeviceRequest& request, const BatchCheckVehicleDeviceAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + BatchCheckVehicleDeviceOutcomeCallable batchCheckVehicleDeviceCallable(const Model::BatchCheckVehicleDeviceRequest& request) const; BatchClearEdgeInstanceDeviceConfigOutcome batchClearEdgeInstanceDeviceConfig(const Model::BatchClearEdgeInstanceDeviceConfigRequest &request)const; void batchClearEdgeInstanceDeviceConfigAsync(const Model::BatchClearEdgeInstanceDeviceConfigRequest& request, const BatchClearEdgeInstanceDeviceConfigAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; BatchClearEdgeInstanceDeviceConfigOutcomeCallable batchClearEdgeInstanceDeviceConfigCallable(const Model::BatchClearEdgeInstanceDeviceConfigRequest& request) const; @@ -2069,6 +2087,9 @@ namespace AlibabaCloud BatchImportDeviceOutcome batchImportDevice(const Model::BatchImportDeviceRequest &request)const; void batchImportDeviceAsync(const Model::BatchImportDeviceRequest& request, const BatchImportDeviceAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; BatchImportDeviceOutcomeCallable batchImportDeviceCallable(const Model::BatchImportDeviceRequest& request) const; + BatchImportVehicleDeviceOutcome batchImportVehicleDevice(const Model::BatchImportVehicleDeviceRequest &request)const; + void batchImportVehicleDeviceAsync(const Model::BatchImportVehicleDeviceRequest& request, const BatchImportVehicleDeviceAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + BatchImportVehicleDeviceOutcomeCallable batchImportVehicleDeviceCallable(const Model::BatchImportVehicleDeviceRequest& request) const; BatchPubOutcome batchPub(const Model::BatchPubRequest &request)const; void batchPubAsync(const Model::BatchPubRequest& request, const BatchPubAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; BatchPubOutcomeCallable batchPubCallable(const Model::BatchPubRequest& request) const; @@ -2951,6 +2972,9 @@ namespace AlibabaCloud QueryTopicRouteTableOutcome queryTopicRouteTable(const Model::QueryTopicRouteTableRequest &request)const; void queryTopicRouteTableAsync(const Model::QueryTopicRouteTableRequest& request, const QueryTopicRouteTableAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; QueryTopicRouteTableOutcomeCallable queryTopicRouteTableCallable(const Model::QueryTopicRouteTableRequest& request) const; + QueryVehicleDeviceOutcome queryVehicleDevice(const Model::QueryVehicleDeviceRequest &request)const; + void queryVehicleDeviceAsync(const Model::QueryVehicleDeviceRequest& request, const QueryVehicleDeviceAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + QueryVehicleDeviceOutcomeCallable queryVehicleDeviceCallable(const Model::QueryVehicleDeviceRequest& request) const; 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; diff --git a/iot/include/alibabacloud/iot/model/BatchCheckVehicleDeviceRequest.h b/iot/include/alibabacloud/iot/model/BatchCheckVehicleDeviceRequest.h new file mode 100644 index 000000000..c62ceacd0 --- /dev/null +++ b/iot/include/alibabacloud/iot/model/BatchCheckVehicleDeviceRequest.h @@ -0,0 +1,70 @@ +/* + * 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_BATCHCHECKVEHICLEDEVICEREQUEST_H_ +#define ALIBABACLOUD_IOT_MODEL_BATCHCHECKVEHICLEDEVICEREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Iot + { + namespace Model + { + class ALIBABACLOUD_IOT_EXPORT BatchCheckVehicleDeviceRequest : public RpcServiceRequest + { + public: + struct DeviceList + { + std::string deviceId; + std::string manufacturer; + std::string deviceModel; + }; + + public: + BatchCheckVehicleDeviceRequest(); + ~BatchCheckVehicleDeviceRequest(); + + std::string getAccessKeyId()const; + void setAccessKeyId(const std::string& accessKeyId); + std::string getIotInstanceId()const; + void setIotInstanceId(const std::string& iotInstanceId); + std::string getProductKey()const; + void setProductKey(const std::string& productKey); + std::vector getDeviceList()const; + void setDeviceList(const std::vector& deviceList); + std::string getApiProduct()const; + void setApiProduct(const std::string& apiProduct); + std::string getApiRevision()const; + void setApiRevision(const std::string& apiRevision); + + private: + std::string accessKeyId_; + std::string iotInstanceId_; + std::string productKey_; + std::vector deviceList_; + std::string apiProduct_; + std::string apiRevision_; + + }; + } + } +} +#endif // !ALIBABACLOUD_IOT_MODEL_BATCHCHECKVEHICLEDEVICEREQUEST_H_ \ No newline at end of file diff --git a/iot/include/alibabacloud/iot/model/BatchCheckVehicleDeviceResult.h b/iot/include/alibabacloud/iot/model/BatchCheckVehicleDeviceResult.h new file mode 100644 index 000000000..0eb355a0f --- /dev/null +++ b/iot/include/alibabacloud/iot/model/BatchCheckVehicleDeviceResult.h @@ -0,0 +1,64 @@ +/* + * 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_BATCHCHECKVEHICLEDEVICERESULT_H_ +#define ALIBABACLOUD_IOT_MODEL_BATCHCHECKVEHICLEDEVICERESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Iot + { + namespace Model + { + class ALIBABACLOUD_IOT_EXPORT BatchCheckVehicleDeviceResult : public ServiceResult + { + public: + struct Data + { + std::vector invalidDeviceIdList; + std::vector repeatedDeviceIdList; + std::vector invalidManufacturerList; + std::vector invalidDeviceModelList; + }; + + + BatchCheckVehicleDeviceResult(); + explicit BatchCheckVehicleDeviceResult(const std::string &payload); + ~BatchCheckVehicleDeviceResult(); + 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_BATCHCHECKVEHICLEDEVICERESULT_H_ \ No newline at end of file diff --git a/iot/include/alibabacloud/iot/model/BatchImportVehicleDeviceRequest.h b/iot/include/alibabacloud/iot/model/BatchImportVehicleDeviceRequest.h new file mode 100644 index 000000000..5e000d872 --- /dev/null +++ b/iot/include/alibabacloud/iot/model/BatchImportVehicleDeviceRequest.h @@ -0,0 +1,70 @@ +/* + * 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_BATCHIMPORTVEHICLEDEVICEREQUEST_H_ +#define ALIBABACLOUD_IOT_MODEL_BATCHIMPORTVEHICLEDEVICEREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Iot + { + namespace Model + { + class ALIBABACLOUD_IOT_EXPORT BatchImportVehicleDeviceRequest : public RpcServiceRequest + { + public: + struct DeviceList + { + std::string deviceId; + std::string manufacturer; + std::string deviceModel; + }; + + public: + BatchImportVehicleDeviceRequest(); + ~BatchImportVehicleDeviceRequest(); + + std::string getAccessKeyId()const; + void setAccessKeyId(const std::string& accessKeyId); + std::string getIotInstanceId()const; + void setIotInstanceId(const std::string& iotInstanceId); + std::string getProductKey()const; + void setProductKey(const std::string& productKey); + std::vector getDeviceList()const; + void setDeviceList(const std::vector& deviceList); + std::string getApiProduct()const; + void setApiProduct(const std::string& apiProduct); + std::string getApiRevision()const; + void setApiRevision(const std::string& apiRevision); + + private: + std::string accessKeyId_; + std::string iotInstanceId_; + std::string productKey_; + std::vector deviceList_; + std::string apiProduct_; + std::string apiRevision_; + + }; + } + } +} +#endif // !ALIBABACLOUD_IOT_MODEL_BATCHIMPORTVEHICLEDEVICEREQUEST_H_ \ No newline at end of file diff --git a/iot/include/alibabacloud/iot/model/BatchImportVehicleDeviceResult.h b/iot/include/alibabacloud/iot/model/BatchImportVehicleDeviceResult.h new file mode 100644 index 000000000..d77f798fb --- /dev/null +++ b/iot/include/alibabacloud/iot/model/BatchImportVehicleDeviceResult.h @@ -0,0 +1,61 @@ +/* + * 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_BATCHIMPORTVEHICLEDEVICERESULT_H_ +#define ALIBABACLOUD_IOT_MODEL_BATCHIMPORTVEHICLEDEVICERESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Iot + { + namespace Model + { + class ALIBABACLOUD_IOT_EXPORT BatchImportVehicleDeviceResult : public ServiceResult + { + public: + struct Data + { + long applyId; + }; + + + BatchImportVehicleDeviceResult(); + explicit BatchImportVehicleDeviceResult(const std::string &payload); + ~BatchImportVehicleDeviceResult(); + 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_BATCHIMPORTVEHICLEDEVICERESULT_H_ \ No newline at end of file diff --git a/iot/include/alibabacloud/iot/model/PubRequest.h b/iot/include/alibabacloud/iot/model/PubRequest.h index c54b99028..91de72cfc 100644 --- a/iot/include/alibabacloud/iot/model/PubRequest.h +++ b/iot/include/alibabacloud/iot/model/PubRequest.h @@ -53,6 +53,8 @@ namespace AlibabaCloud void setCorrelationData(const std::string& correlationData); std::string getIotInstanceId()const; void setIotInstanceId(const std::string& iotInstanceId); + long getMessageExpiryInterval()const; + void setMessageExpiryInterval(long messageExpiryInterval); std::string getResponseTopic()const; void setResponseTopic(const std::string& responseTopic); std::string getTopicFullName()const; @@ -63,6 +65,8 @@ namespace AlibabaCloud void setProductKey(const std::string& productKey); std::string getContentType()const; void setContentType(const std::string& contentType); + bool getRetained()const; + void setRetained(bool retained); std::string getApiProduct()const; void setApiProduct(const std::string& apiProduct); std::string getApiRevision()const; @@ -77,11 +81,13 @@ namespace AlibabaCloud int qos_; std::string correlationData_; std::string iotInstanceId_; + long messageExpiryInterval_; std::string responseTopic_; std::string topicFullName_; int payloadFormatIndicator_; std::string productKey_; std::string contentType_; + bool retained_; std::string apiProduct_; std::string apiRevision_; std::string deviceName_; diff --git a/iot/include/alibabacloud/iot/model/QueryVehicleDeviceRequest.h b/iot/include/alibabacloud/iot/model/QueryVehicleDeviceRequest.h new file mode 100644 index 000000000..5054fa73f --- /dev/null +++ b/iot/include/alibabacloud/iot/model/QueryVehicleDeviceRequest.h @@ -0,0 +1,69 @@ +/* + * 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_QUERYVEHICLEDEVICEREQUEST_H_ +#define ALIBABACLOUD_IOT_MODEL_QUERYVEHICLEDEVICEREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Iot + { + namespace Model + { + class ALIBABACLOUD_IOT_EXPORT QueryVehicleDeviceRequest : public RpcServiceRequest + { + + public: + QueryVehicleDeviceRequest(); + ~QueryVehicleDeviceRequest(); + + std::string getRealTenantId()const; + void setRealTenantId(const std::string& realTenantId); + std::string getAccessKeyId()const; + void setAccessKeyId(const std::string& accessKeyId); + std::string getRealTripartiteKey()const; + void setRealTripartiteKey(const std::string& realTripartiteKey); + 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 realTenantId_; + std::string accessKeyId_; + std::string realTripartiteKey_; + std::string iotInstanceId_; + std::string productKey_; + std::string apiProduct_; + std::string apiRevision_; + std::string deviceName_; + + }; + } + } +} +#endif // !ALIBABACLOUD_IOT_MODEL_QUERYVEHICLEDEVICEREQUEST_H_ \ No newline at end of file diff --git a/iot/include/alibabacloud/iot/model/QueryVehicleDeviceResult.h b/iot/include/alibabacloud/iot/model/QueryVehicleDeviceResult.h new file mode 100644 index 000000000..6e9e3bbee --- /dev/null +++ b/iot/include/alibabacloud/iot/model/QueryVehicleDeviceResult.h @@ -0,0 +1,75 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_IOT_MODEL_QUERYVEHICLEDEVICERESULT_H_ +#define ALIBABACLOUD_IOT_MODEL_QUERYVEHICLEDEVICERESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Iot + { + namespace Model + { + class ALIBABACLOUD_IOT_EXPORT QueryVehicleDeviceResult : public ServiceResult + { + public: + struct Data + { + std::string deviceModel; + std::string status; + std::string authCode; + std::string deviceId; + long createTime; + std::string vehicleColour; + std::string city; + std::string province; + std::string iotId; + long registerTime; + long modifiedTime; + std::string manufacturer; + std::string productKey; + std::string vehicleNumber; + std::string deviceName; + }; + + + QueryVehicleDeviceResult(); + explicit QueryVehicleDeviceResult(const std::string &payload); + ~QueryVehicleDeviceResult(); + 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_QUERYVEHICLEDEVICERESULT_H_ \ No newline at end of file diff --git a/iot/include/alibabacloud/iot/model/RRpcRequest.h b/iot/include/alibabacloud/iot/model/RRpcRequest.h index 4906938d2..b4e9b5eab 100644 --- a/iot/include/alibabacloud/iot/model/RRpcRequest.h +++ b/iot/include/alibabacloud/iot/model/RRpcRequest.h @@ -45,6 +45,8 @@ namespace AlibabaCloud void setRequestBase64Byte(const std::string& requestBase64Byte); std::string getProductKey()const; void setProductKey(const std::string& productKey); + std::string getContentType()const; + void setContentType(const std::string& contentType); std::string getApiProduct()const; void setApiProduct(const std::string& apiProduct); std::string getTopic()const; @@ -60,6 +62,7 @@ namespace AlibabaCloud std::string iotInstanceId_; std::string requestBase64Byte_; std::string productKey_; + std::string contentType_; std::string apiProduct_; std::string topic_; std::string apiRevision_; diff --git a/iot/src/IotClient.cc b/iot/src/IotClient.cc index 62ec6f299..a95072f7c 100644 --- a/iot/src/IotClient.cc +++ b/iot/src/IotClient.cc @@ -483,6 +483,42 @@ IotClient::BatchCheckImportDeviceOutcomeCallable IotClient::batchCheckImportDevi return task->get_future(); } +IotClient::BatchCheckVehicleDeviceOutcome IotClient::batchCheckVehicleDevice(const BatchCheckVehicleDeviceRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return BatchCheckVehicleDeviceOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return BatchCheckVehicleDeviceOutcome(BatchCheckVehicleDeviceResult(outcome.result())); + else + return BatchCheckVehicleDeviceOutcome(outcome.error()); +} + +void IotClient::batchCheckVehicleDeviceAsync(const BatchCheckVehicleDeviceRequest& request, const BatchCheckVehicleDeviceAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, batchCheckVehicleDevice(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +IotClient::BatchCheckVehicleDeviceOutcomeCallable IotClient::batchCheckVehicleDeviceCallable(const BatchCheckVehicleDeviceRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->batchCheckVehicleDevice(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + IotClient::BatchClearEdgeInstanceDeviceConfigOutcome IotClient::batchClearEdgeInstanceDeviceConfig(const BatchClearEdgeInstanceDeviceConfigRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); @@ -987,6 +1023,42 @@ IotClient::BatchImportDeviceOutcomeCallable IotClient::batchImportDeviceCallable return task->get_future(); } +IotClient::BatchImportVehicleDeviceOutcome IotClient::batchImportVehicleDevice(const BatchImportVehicleDeviceRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return BatchImportVehicleDeviceOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return BatchImportVehicleDeviceOutcome(BatchImportVehicleDeviceResult(outcome.result())); + else + return BatchImportVehicleDeviceOutcome(outcome.error()); +} + +void IotClient::batchImportVehicleDeviceAsync(const BatchImportVehicleDeviceRequest& request, const BatchImportVehicleDeviceAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, batchImportVehicleDevice(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +IotClient::BatchImportVehicleDeviceOutcomeCallable IotClient::batchImportVehicleDeviceCallable(const BatchImportVehicleDeviceRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->batchImportVehicleDevice(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + IotClient::BatchPubOutcome IotClient::batchPub(const BatchPubRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); @@ -11571,6 +11643,42 @@ IotClient::QueryTopicRouteTableOutcomeCallable IotClient::queryTopicRouteTableCa return task->get_future(); } +IotClient::QueryVehicleDeviceOutcome IotClient::queryVehicleDevice(const QueryVehicleDeviceRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return QueryVehicleDeviceOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return QueryVehicleDeviceOutcome(QueryVehicleDeviceResult(outcome.result())); + else + return QueryVehicleDeviceOutcome(outcome.error()); +} + +void IotClient::queryVehicleDeviceAsync(const QueryVehicleDeviceRequest& request, const QueryVehicleDeviceAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, queryVehicleDevice(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +IotClient::QueryVehicleDeviceOutcomeCallable IotClient::queryVehicleDeviceCallable(const QueryVehicleDeviceRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->queryVehicleDevice(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + IotClient::RRpcOutcome IotClient::rRpc(const RRpcRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); diff --git a/iot/src/model/BatchCheckVehicleDeviceRequest.cc b/iot/src/model/BatchCheckVehicleDeviceRequest.cc new file mode 100644 index 000000000..374aee1d1 --- /dev/null +++ b/iot/src/model/BatchCheckVehicleDeviceRequest.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 + +using AlibabaCloud::Iot::Model::BatchCheckVehicleDeviceRequest; + +BatchCheckVehicleDeviceRequest::BatchCheckVehicleDeviceRequest() : + RpcServiceRequest("iot", "2018-01-20", "BatchCheckVehicleDevice") +{ + setMethod(HttpRequest::Method::Post); +} + +BatchCheckVehicleDeviceRequest::~BatchCheckVehicleDeviceRequest() +{} + +std::string BatchCheckVehicleDeviceRequest::getAccessKeyId()const +{ + return accessKeyId_; +} + +void BatchCheckVehicleDeviceRequest::setAccessKeyId(const std::string& accessKeyId) +{ + accessKeyId_ = accessKeyId; + setParameter("AccessKeyId", accessKeyId); +} + +std::string BatchCheckVehicleDeviceRequest::getIotInstanceId()const +{ + return iotInstanceId_; +} + +void BatchCheckVehicleDeviceRequest::setIotInstanceId(const std::string& iotInstanceId) +{ + iotInstanceId_ = iotInstanceId; + setParameter("IotInstanceId", iotInstanceId); +} + +std::string BatchCheckVehicleDeviceRequest::getProductKey()const +{ + return productKey_; +} + +void BatchCheckVehicleDeviceRequest::setProductKey(const std::string& productKey) +{ + productKey_ = productKey; + setParameter("ProductKey", productKey); +} + +std::vector BatchCheckVehicleDeviceRequest::getDeviceList()const +{ + return deviceList_; +} + +void BatchCheckVehicleDeviceRequest::setDeviceList(const std::vector& deviceList) +{ + deviceList_ = deviceList; + for(int dep1 = 0; dep1!= deviceList.size(); dep1++) { + auto deviceListObj = deviceList.at(dep1); + std::string deviceListObjStr = "DeviceList." + std::to_string(dep1 + 1); + setParameter(deviceListObjStr + ".DeviceId", deviceListObj.deviceId); + setParameter(deviceListObjStr + ".Manufacturer", deviceListObj.manufacturer); + setParameter(deviceListObjStr + ".DeviceModel", deviceListObj.deviceModel); + } +} + +std::string BatchCheckVehicleDeviceRequest::getApiProduct()const +{ + return apiProduct_; +} + +void BatchCheckVehicleDeviceRequest::setApiProduct(const std::string& apiProduct) +{ + apiProduct_ = apiProduct; + setBodyParameter("ApiProduct", apiProduct); +} + +std::string BatchCheckVehicleDeviceRequest::getApiRevision()const +{ + return apiRevision_; +} + +void BatchCheckVehicleDeviceRequest::setApiRevision(const std::string& apiRevision) +{ + apiRevision_ = apiRevision; + setBodyParameter("ApiRevision", apiRevision); +} + diff --git a/iot/src/model/BatchCheckVehicleDeviceResult.cc b/iot/src/model/BatchCheckVehicleDeviceResult.cc new file mode 100644 index 000000000..3b710132e --- /dev/null +++ b/iot/src/model/BatchCheckVehicleDeviceResult.cc @@ -0,0 +1,83 @@ +/* + * 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; + +BatchCheckVehicleDeviceResult::BatchCheckVehicleDeviceResult() : + ServiceResult() +{} + +BatchCheckVehicleDeviceResult::BatchCheckVehicleDeviceResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +BatchCheckVehicleDeviceResult::~BatchCheckVehicleDeviceResult() +{} + +void BatchCheckVehicleDeviceResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto dataNode = value["Data"]; + auto allInvalidManufacturerList = dataNode["InvalidManufacturerList"]["invalidManufacturerList"]; + for (auto value : allInvalidManufacturerList) + data_.invalidManufacturerList.push_back(value.asString()); + auto allInvalidDeviceModelList = dataNode["InvalidDeviceModelList"]["invalidDeviceModelList"]; + for (auto value : allInvalidDeviceModelList) + data_.invalidDeviceModelList.push_back(value.asString()); + auto allInvalidDeviceIdList = dataNode["InvalidDeviceIdList"]["invalidDeviceIdList"]; + for (auto value : allInvalidDeviceIdList) + data_.invalidDeviceIdList.push_back(value.asString()); + auto allRepeatedDeviceIdList = dataNode["RepeatedDeviceIdList"]["repeatedDeviceIdList"]; + for (auto value : allRepeatedDeviceIdList) + data_.repeatedDeviceIdList.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(); + +} + +BatchCheckVehicleDeviceResult::Data BatchCheckVehicleDeviceResult::getData()const +{ + return data_; +} + +std::string BatchCheckVehicleDeviceResult::getErrorMessage()const +{ + return errorMessage_; +} + +std::string BatchCheckVehicleDeviceResult::getCode()const +{ + return code_; +} + +bool BatchCheckVehicleDeviceResult::getSuccess()const +{ + return success_; +} + diff --git a/iot/src/model/BatchImportVehicleDeviceRequest.cc b/iot/src/model/BatchImportVehicleDeviceRequest.cc new file mode 100644 index 000000000..53cad8553 --- /dev/null +++ b/iot/src/model/BatchImportVehicleDeviceRequest.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 + +using AlibabaCloud::Iot::Model::BatchImportVehicleDeviceRequest; + +BatchImportVehicleDeviceRequest::BatchImportVehicleDeviceRequest() : + RpcServiceRequest("iot", "2018-01-20", "BatchImportVehicleDevice") +{ + setMethod(HttpRequest::Method::Post); +} + +BatchImportVehicleDeviceRequest::~BatchImportVehicleDeviceRequest() +{} + +std::string BatchImportVehicleDeviceRequest::getAccessKeyId()const +{ + return accessKeyId_; +} + +void BatchImportVehicleDeviceRequest::setAccessKeyId(const std::string& accessKeyId) +{ + accessKeyId_ = accessKeyId; + setParameter("AccessKeyId", accessKeyId); +} + +std::string BatchImportVehicleDeviceRequest::getIotInstanceId()const +{ + return iotInstanceId_; +} + +void BatchImportVehicleDeviceRequest::setIotInstanceId(const std::string& iotInstanceId) +{ + iotInstanceId_ = iotInstanceId; + setParameter("IotInstanceId", iotInstanceId); +} + +std::string BatchImportVehicleDeviceRequest::getProductKey()const +{ + return productKey_; +} + +void BatchImportVehicleDeviceRequest::setProductKey(const std::string& productKey) +{ + productKey_ = productKey; + setParameter("ProductKey", productKey); +} + +std::vector BatchImportVehicleDeviceRequest::getDeviceList()const +{ + return deviceList_; +} + +void BatchImportVehicleDeviceRequest::setDeviceList(const std::vector& deviceList) +{ + deviceList_ = deviceList; + for(int dep1 = 0; dep1!= deviceList.size(); dep1++) { + auto deviceListObj = deviceList.at(dep1); + std::string deviceListObjStr = "DeviceList." + std::to_string(dep1 + 1); + setParameter(deviceListObjStr + ".DeviceId", deviceListObj.deviceId); + setParameter(deviceListObjStr + ".Manufacturer", deviceListObj.manufacturer); + setParameter(deviceListObjStr + ".DeviceModel", deviceListObj.deviceModel); + } +} + +std::string BatchImportVehicleDeviceRequest::getApiProduct()const +{ + return apiProduct_; +} + +void BatchImportVehicleDeviceRequest::setApiProduct(const std::string& apiProduct) +{ + apiProduct_ = apiProduct; + setBodyParameter("ApiProduct", apiProduct); +} + +std::string BatchImportVehicleDeviceRequest::getApiRevision()const +{ + return apiRevision_; +} + +void BatchImportVehicleDeviceRequest::setApiRevision(const std::string& apiRevision) +{ + apiRevision_ = apiRevision; + setBodyParameter("ApiRevision", apiRevision); +} + diff --git a/iot/src/model/BatchImportVehicleDeviceResult.cc b/iot/src/model/BatchImportVehicleDeviceResult.cc new file mode 100644 index 000000000..6390f06c6 --- /dev/null +++ b/iot/src/model/BatchImportVehicleDeviceResult.cc @@ -0,0 +1,73 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +using namespace AlibabaCloud::Iot; +using namespace AlibabaCloud::Iot::Model; + +BatchImportVehicleDeviceResult::BatchImportVehicleDeviceResult() : + ServiceResult() +{} + +BatchImportVehicleDeviceResult::BatchImportVehicleDeviceResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +BatchImportVehicleDeviceResult::~BatchImportVehicleDeviceResult() +{} + +void BatchImportVehicleDeviceResult::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["ApplyId"].isNull()) + data_.applyId = std::stol(dataNode["ApplyId"].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(); + +} + +BatchImportVehicleDeviceResult::Data BatchImportVehicleDeviceResult::getData()const +{ + return data_; +} + +std::string BatchImportVehicleDeviceResult::getErrorMessage()const +{ + return errorMessage_; +} + +std::string BatchImportVehicleDeviceResult::getCode()const +{ + return code_; +} + +bool BatchImportVehicleDeviceResult::getSuccess()const +{ + return success_; +} + diff --git a/iot/src/model/PubRequest.cc b/iot/src/model/PubRequest.cc index 0dac6c43e..fabd64e20 100644 --- a/iot/src/model/PubRequest.cc +++ b/iot/src/model/PubRequest.cc @@ -98,6 +98,17 @@ void PubRequest::setIotInstanceId(const std::string& iotInstanceId) setParameter("IotInstanceId", iotInstanceId); } +long PubRequest::getMessageExpiryInterval()const +{ + return messageExpiryInterval_; +} + +void PubRequest::setMessageExpiryInterval(long messageExpiryInterval) +{ + messageExpiryInterval_ = messageExpiryInterval; + setParameter("MessageExpiryInterval", std::to_string(messageExpiryInterval)); +} + std::string PubRequest::getResponseTopic()const { return responseTopic_; @@ -153,6 +164,17 @@ void PubRequest::setContentType(const std::string& contentType) setParameter("ContentType", contentType); } +bool PubRequest::getRetained()const +{ + return retained_; +} + +void PubRequest::setRetained(bool retained) +{ + retained_ = retained; + setParameter("Retained", retained ? "true" : "false"); +} + std::string PubRequest::getApiProduct()const { return apiProduct_; diff --git a/iot/src/model/QueryVehicleDeviceRequest.cc b/iot/src/model/QueryVehicleDeviceRequest.cc new file mode 100644 index 000000000..e12376125 --- /dev/null +++ b/iot/src/model/QueryVehicleDeviceRequest.cc @@ -0,0 +1,117 @@ +/* + * 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::QueryVehicleDeviceRequest; + +QueryVehicleDeviceRequest::QueryVehicleDeviceRequest() : + RpcServiceRequest("iot", "2018-01-20", "QueryVehicleDevice") +{ + setMethod(HttpRequest::Method::Post); +} + +QueryVehicleDeviceRequest::~QueryVehicleDeviceRequest() +{} + +std::string QueryVehicleDeviceRequest::getRealTenantId()const +{ + return realTenantId_; +} + +void QueryVehicleDeviceRequest::setRealTenantId(const std::string& realTenantId) +{ + realTenantId_ = realTenantId; + setParameter("RealTenantId", realTenantId); +} + +std::string QueryVehicleDeviceRequest::getAccessKeyId()const +{ + return accessKeyId_; +} + +void QueryVehicleDeviceRequest::setAccessKeyId(const std::string& accessKeyId) +{ + accessKeyId_ = accessKeyId; + setParameter("AccessKeyId", accessKeyId); +} + +std::string QueryVehicleDeviceRequest::getRealTripartiteKey()const +{ + return realTripartiteKey_; +} + +void QueryVehicleDeviceRequest::setRealTripartiteKey(const std::string& realTripartiteKey) +{ + realTripartiteKey_ = realTripartiteKey; + setParameter("RealTripartiteKey", realTripartiteKey); +} + +std::string QueryVehicleDeviceRequest::getIotInstanceId()const +{ + return iotInstanceId_; +} + +void QueryVehicleDeviceRequest::setIotInstanceId(const std::string& iotInstanceId) +{ + iotInstanceId_ = iotInstanceId; + setParameter("IotInstanceId", iotInstanceId); +} + +std::string QueryVehicleDeviceRequest::getProductKey()const +{ + return productKey_; +} + +void QueryVehicleDeviceRequest::setProductKey(const std::string& productKey) +{ + productKey_ = productKey; + setParameter("ProductKey", productKey); +} + +std::string QueryVehicleDeviceRequest::getApiProduct()const +{ + return apiProduct_; +} + +void QueryVehicleDeviceRequest::setApiProduct(const std::string& apiProduct) +{ + apiProduct_ = apiProduct; + setBodyParameter("ApiProduct", apiProduct); +} + +std::string QueryVehicleDeviceRequest::getApiRevision()const +{ + return apiRevision_; +} + +void QueryVehicleDeviceRequest::setApiRevision(const std::string& apiRevision) +{ + apiRevision_ = apiRevision; + setBodyParameter("ApiRevision", apiRevision); +} + +std::string QueryVehicleDeviceRequest::getDeviceName()const +{ + return deviceName_; +} + +void QueryVehicleDeviceRequest::setDeviceName(const std::string& deviceName) +{ + deviceName_ = deviceName; + setParameter("DeviceName", deviceName); +} + diff --git a/iot/src/model/QueryVehicleDeviceResult.cc b/iot/src/model/QueryVehicleDeviceResult.cc new file mode 100644 index 000000000..6ffd5c25b --- /dev/null +++ b/iot/src/model/QueryVehicleDeviceResult.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; + +QueryVehicleDeviceResult::QueryVehicleDeviceResult() : + ServiceResult() +{} + +QueryVehicleDeviceResult::QueryVehicleDeviceResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +QueryVehicleDeviceResult::~QueryVehicleDeviceResult() +{} + +void QueryVehicleDeviceResult::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["IotId"].isNull()) + data_.iotId = dataNode["IotId"].asString(); + if(!dataNode["ProductKey"].isNull()) + data_.productKey = dataNode["ProductKey"].asString(); + if(!dataNode["DeviceName"].isNull()) + data_.deviceName = dataNode["DeviceName"].asString(); + if(!dataNode["Manufacturer"].isNull()) + data_.manufacturer = dataNode["Manufacturer"].asString(); + if(!dataNode["DeviceModel"].isNull()) + data_.deviceModel = dataNode["DeviceModel"].asString(); + if(!dataNode["DeviceId"].isNull()) + data_.deviceId = dataNode["DeviceId"].asString(); + if(!dataNode["Status"].isNull()) + data_.status = dataNode["Status"].asString(); + if(!dataNode["AuthCode"].isNull()) + data_.authCode = dataNode["AuthCode"].asString(); + if(!dataNode["Province"].isNull()) + data_.province = dataNode["Province"].asString(); + if(!dataNode["City"].isNull()) + data_.city = dataNode["City"].asString(); + if(!dataNode["VehicleColour"].isNull()) + data_.vehicleColour = dataNode["VehicleColour"].asString(); + if(!dataNode["VehicleNumber"].isNull()) + data_.vehicleNumber = dataNode["VehicleNumber"].asString(); + if(!dataNode["CreateTime"].isNull()) + data_.createTime = std::stol(dataNode["CreateTime"].asString()); + if(!dataNode["ModifiedTime"].isNull()) + data_.modifiedTime = std::stol(dataNode["ModifiedTime"].asString()); + if(!dataNode["RegisterTime"].isNull()) + data_.registerTime = std::stol(dataNode["RegisterTime"].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(); + +} + +QueryVehicleDeviceResult::Data QueryVehicleDeviceResult::getData()const +{ + return data_; +} + +std::string QueryVehicleDeviceResult::getErrorMessage()const +{ + return errorMessage_; +} + +std::string QueryVehicleDeviceResult::getCode()const +{ + return code_; +} + +bool QueryVehicleDeviceResult::getSuccess()const +{ + return success_; +} + diff --git a/iot/src/model/RRpcRequest.cc b/iot/src/model/RRpcRequest.cc index a8c6ee90c..a5962871d 100644 --- a/iot/src/model/RRpcRequest.cc +++ b/iot/src/model/RRpcRequest.cc @@ -82,6 +82,17 @@ void RRpcRequest::setProductKey(const std::string& productKey) setParameter("ProductKey", productKey); } +std::string RRpcRequest::getContentType()const +{ + return contentType_; +} + +void RRpcRequest::setContentType(const std::string& contentType) +{ + contentType_ = contentType; + setParameter("ContentType", contentType); +} + std::string RRpcRequest::getApiProduct()const { return apiProduct_;