diff --git a/CHANGELOG b/CHANGELOG index c60105550..af6e490c6 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2019-10-14 Version 1.36.149 +- Support continuous pushing. + 2019-10-09 Version 1.36.148 - Add VideoCancelScan Api. diff --git a/VERSION b/VERSION index 681b9d696..15bc08226 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.148 \ No newline at end of file +1.36.149 \ No newline at end of file diff --git a/push/CMakeLists.txt b/push/CMakeLists.txt index 41065038b..f8fa47d29 100644 --- a/push/CMakeLists.txt +++ b/push/CMakeLists.txt @@ -33,6 +33,10 @@ set(push_public_header_model include/alibabacloud/push/model/CheckDeviceResult.h include/alibabacloud/push/model/CheckDevicesRequest.h include/alibabacloud/push/model/CheckDevicesResult.h + include/alibabacloud/push/model/CompleteContinuouslyPushRequest.h + include/alibabacloud/push/model/CompleteContinuouslyPushResult.h + include/alibabacloud/push/model/ContinuouslyPushRequest.h + include/alibabacloud/push/model/ContinuouslyPushResult.h include/alibabacloud/push/model/ListPushRecordsRequest.h include/alibabacloud/push/model/ListPushRecordsResult.h include/alibabacloud/push/model/ListSummaryAppsRequest.h @@ -94,6 +98,10 @@ set(push_src src/model/CheckDeviceResult.cc src/model/CheckDevicesRequest.cc src/model/CheckDevicesResult.cc + src/model/CompleteContinuouslyPushRequest.cc + src/model/CompleteContinuouslyPushResult.cc + src/model/ContinuouslyPushRequest.cc + src/model/ContinuouslyPushResult.cc src/model/ListPushRecordsRequest.cc src/model/ListPushRecordsResult.cc src/model/ListSummaryAppsRequest.cc diff --git a/push/include/alibabacloud/push/PushClient.h b/push/include/alibabacloud/push/PushClient.h index 76bb89947..3ad12f3bb 100644 --- a/push/include/alibabacloud/push/PushClient.h +++ b/push/include/alibabacloud/push/PushClient.h @@ -34,6 +34,10 @@ #include "model/CheckDeviceResult.h" #include "model/CheckDevicesRequest.h" #include "model/CheckDevicesResult.h" +#include "model/CompleteContinuouslyPushRequest.h" +#include "model/CompleteContinuouslyPushResult.h" +#include "model/ContinuouslyPushRequest.h" +#include "model/ContinuouslyPushResult.h" #include "model/ListPushRecordsRequest.h" #include "model/ListPushRecordsResult.h" #include "model/ListSummaryAppsRequest.h" @@ -107,6 +111,12 @@ namespace AlibabaCloud typedef Outcome CheckDevicesOutcome; typedef std::future CheckDevicesOutcomeCallable; typedef std::function&)> CheckDevicesAsyncHandler; + typedef Outcome CompleteContinuouslyPushOutcome; + typedef std::future CompleteContinuouslyPushOutcomeCallable; + typedef std::function&)> CompleteContinuouslyPushAsyncHandler; + typedef Outcome ContinuouslyPushOutcome; + typedef std::future ContinuouslyPushOutcomeCallable; + typedef std::function&)> ContinuouslyPushAsyncHandler; typedef Outcome ListPushRecordsOutcome; typedef std::future ListPushRecordsOutcomeCallable; typedef std::function&)> ListPushRecordsAsyncHandler; @@ -199,6 +209,12 @@ namespace AlibabaCloud CheckDevicesOutcome checkDevices(const Model::CheckDevicesRequest &request)const; void checkDevicesAsync(const Model::CheckDevicesRequest& request, const CheckDevicesAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; CheckDevicesOutcomeCallable checkDevicesCallable(const Model::CheckDevicesRequest& request) const; + CompleteContinuouslyPushOutcome completeContinuouslyPush(const Model::CompleteContinuouslyPushRequest &request)const; + void completeContinuouslyPushAsync(const Model::CompleteContinuouslyPushRequest& request, const CompleteContinuouslyPushAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + CompleteContinuouslyPushOutcomeCallable completeContinuouslyPushCallable(const Model::CompleteContinuouslyPushRequest& request) const; + ContinuouslyPushOutcome continuouslyPush(const Model::ContinuouslyPushRequest &request)const; + void continuouslyPushAsync(const Model::ContinuouslyPushRequest& request, const ContinuouslyPushAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + ContinuouslyPushOutcomeCallable continuouslyPushCallable(const Model::ContinuouslyPushRequest& request) const; ListPushRecordsOutcome listPushRecords(const Model::ListPushRecordsRequest &request)const; void listPushRecordsAsync(const Model::ListPushRecordsRequest& request, const ListPushRecordsAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; ListPushRecordsOutcomeCallable listPushRecordsCallable(const Model::ListPushRecordsRequest& request) const; diff --git a/push/include/alibabacloud/push/model/CompleteContinuouslyPushRequest.h b/push/include/alibabacloud/push/model/CompleteContinuouslyPushRequest.h new file mode 100644 index 000000000..5b3688f8b --- /dev/null +++ b/push/include/alibabacloud/push/model/CompleteContinuouslyPushRequest.h @@ -0,0 +1,54 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_PUSH_MODEL_COMPLETECONTINUOUSLYPUSHREQUEST_H_ +#define ALIBABACLOUD_PUSH_MODEL_COMPLETECONTINUOUSLYPUSHREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Push + { + namespace Model + { + class ALIBABACLOUD_PUSH_EXPORT CompleteContinuouslyPushRequest : public RpcServiceRequest + { + + public: + CompleteContinuouslyPushRequest(); + ~CompleteContinuouslyPushRequest(); + + std::string getMessageId()const; + void setMessageId(const std::string& messageId); + std::string getAccessKeyId()const; + void setAccessKeyId(const std::string& accessKeyId); + long getAppKey()const; + void setAppKey(long appKey); + + private: + std::string messageId_; + std::string accessKeyId_; + long appKey_; + + }; + } + } +} +#endif // !ALIBABACLOUD_PUSH_MODEL_COMPLETECONTINUOUSLYPUSHREQUEST_H_ \ No newline at end of file diff --git a/push/include/alibabacloud/push/model/CompleteContinuouslyPushResult.h b/push/include/alibabacloud/push/model/CompleteContinuouslyPushResult.h new file mode 100644 index 000000000..a1450600d --- /dev/null +++ b/push/include/alibabacloud/push/model/CompleteContinuouslyPushResult.h @@ -0,0 +1,51 @@ +/* + * 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_PUSH_MODEL_COMPLETECONTINUOUSLYPUSHRESULT_H_ +#define ALIBABACLOUD_PUSH_MODEL_COMPLETECONTINUOUSLYPUSHRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Push + { + namespace Model + { + class ALIBABACLOUD_PUSH_EXPORT CompleteContinuouslyPushResult : public ServiceResult + { + public: + + + CompleteContinuouslyPushResult(); + explicit CompleteContinuouslyPushResult(const std::string &payload); + ~CompleteContinuouslyPushResult(); + std::string getMessageId()const; + + protected: + void parse(const std::string &payload); + private: + std::string messageId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_PUSH_MODEL_COMPLETECONTINUOUSLYPUSHRESULT_H_ \ No newline at end of file diff --git a/push/include/alibabacloud/push/model/ContinuouslyPushRequest.h b/push/include/alibabacloud/push/model/ContinuouslyPushRequest.h new file mode 100644 index 000000000..fe8878d95 --- /dev/null +++ b/push/include/alibabacloud/push/model/ContinuouslyPushRequest.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_PUSH_MODEL_CONTINUOUSLYPUSHREQUEST_H_ +#define ALIBABACLOUD_PUSH_MODEL_CONTINUOUSLYPUSHREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Push + { + namespace Model + { + class ALIBABACLOUD_PUSH_EXPORT ContinuouslyPushRequest : public RpcServiceRequest + { + + public: + ContinuouslyPushRequest(); + ~ContinuouslyPushRequest(); + + std::string getMessageId()const; + void setMessageId(const std::string& messageId); + std::string getAccessKeyId()const; + void setAccessKeyId(const std::string& accessKeyId); + std::string getTarget()const; + void setTarget(const std::string& target); + long getAppKey()const; + void setAppKey(long appKey); + std::string getTargetValue()const; + void setTargetValue(const std::string& targetValue); + + private: + std::string messageId_; + std::string accessKeyId_; + std::string target_; + long appKey_; + std::string targetValue_; + + }; + } + } +} +#endif // !ALIBABACLOUD_PUSH_MODEL_CONTINUOUSLYPUSHREQUEST_H_ \ No newline at end of file diff --git a/push/include/alibabacloud/push/model/ContinuouslyPushResult.h b/push/include/alibabacloud/push/model/ContinuouslyPushResult.h new file mode 100644 index 000000000..2e15abe43 --- /dev/null +++ b/push/include/alibabacloud/push/model/ContinuouslyPushResult.h @@ -0,0 +1,51 @@ +/* + * 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_PUSH_MODEL_CONTINUOUSLYPUSHRESULT_H_ +#define ALIBABACLOUD_PUSH_MODEL_CONTINUOUSLYPUSHRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Push + { + namespace Model + { + class ALIBABACLOUD_PUSH_EXPORT ContinuouslyPushResult : public ServiceResult + { + public: + + + ContinuouslyPushResult(); + explicit ContinuouslyPushResult(const std::string &payload); + ~ContinuouslyPushResult(); + std::string getMessageId()const; + + protected: + void parse(const std::string &payload); + private: + std::string messageId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_PUSH_MODEL_CONTINUOUSLYPUSHRESULT_H_ \ No newline at end of file diff --git a/push/src/PushClient.cc b/push/src/PushClient.cc index 4772eff47..e33295407 100644 --- a/push/src/PushClient.cc +++ b/push/src/PushClient.cc @@ -267,6 +267,78 @@ PushClient::CheckDevicesOutcomeCallable PushClient::checkDevicesCallable(const C return task->get_future(); } +PushClient::CompleteContinuouslyPushOutcome PushClient::completeContinuouslyPush(const CompleteContinuouslyPushRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return CompleteContinuouslyPushOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return CompleteContinuouslyPushOutcome(CompleteContinuouslyPushResult(outcome.result())); + else + return CompleteContinuouslyPushOutcome(outcome.error()); +} + +void PushClient::completeContinuouslyPushAsync(const CompleteContinuouslyPushRequest& request, const CompleteContinuouslyPushAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, completeContinuouslyPush(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +PushClient::CompleteContinuouslyPushOutcomeCallable PushClient::completeContinuouslyPushCallable(const CompleteContinuouslyPushRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->completeContinuouslyPush(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +PushClient::ContinuouslyPushOutcome PushClient::continuouslyPush(const ContinuouslyPushRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return ContinuouslyPushOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return ContinuouslyPushOutcome(ContinuouslyPushResult(outcome.result())); + else + return ContinuouslyPushOutcome(outcome.error()); +} + +void PushClient::continuouslyPushAsync(const ContinuouslyPushRequest& request, const ContinuouslyPushAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, continuouslyPush(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +PushClient::ContinuouslyPushOutcomeCallable PushClient::continuouslyPushCallable(const ContinuouslyPushRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->continuouslyPush(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + PushClient::ListPushRecordsOutcome PushClient::listPushRecords(const ListPushRecordsRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); diff --git a/push/src/model/CompleteContinuouslyPushRequest.cc b/push/src/model/CompleteContinuouslyPushRequest.cc new file mode 100644 index 000000000..8819c3df5 --- /dev/null +++ b/push/src/model/CompleteContinuouslyPushRequest.cc @@ -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. + */ + +#include + +using AlibabaCloud::Push::Model::CompleteContinuouslyPushRequest; + +CompleteContinuouslyPushRequest::CompleteContinuouslyPushRequest() : + RpcServiceRequest("push", "2016-08-01", "CompleteContinuouslyPush") +{} + +CompleteContinuouslyPushRequest::~CompleteContinuouslyPushRequest() +{} + +std::string CompleteContinuouslyPushRequest::getMessageId()const +{ + return messageId_; +} + +void CompleteContinuouslyPushRequest::setMessageId(const std::string& messageId) +{ + messageId_ = messageId; + setCoreParameter("MessageId", messageId); +} + +std::string CompleteContinuouslyPushRequest::getAccessKeyId()const +{ + return accessKeyId_; +} + +void CompleteContinuouslyPushRequest::setAccessKeyId(const std::string& accessKeyId) +{ + accessKeyId_ = accessKeyId; + setCoreParameter("AccessKeyId", accessKeyId); +} + +long CompleteContinuouslyPushRequest::getAppKey()const +{ + return appKey_; +} + +void CompleteContinuouslyPushRequest::setAppKey(long appKey) +{ + appKey_ = appKey; + setCoreParameter("AppKey", std::to_string(appKey)); +} + diff --git a/push/src/model/CompleteContinuouslyPushResult.cc b/push/src/model/CompleteContinuouslyPushResult.cc new file mode 100644 index 000000000..8629502d0 --- /dev/null +++ b/push/src/model/CompleteContinuouslyPushResult.cc @@ -0,0 +1,51 @@ +/* + * 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::Push; +using namespace AlibabaCloud::Push::Model; + +CompleteContinuouslyPushResult::CompleteContinuouslyPushResult() : + ServiceResult() +{} + +CompleteContinuouslyPushResult::CompleteContinuouslyPushResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +CompleteContinuouslyPushResult::~CompleteContinuouslyPushResult() +{} + +void CompleteContinuouslyPushResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + if(!value["MessageId"].isNull()) + messageId_ = value["MessageId"].asString(); + +} + +std::string CompleteContinuouslyPushResult::getMessageId()const +{ + return messageId_; +} + diff --git a/push/src/model/ContinuouslyPushRequest.cc b/push/src/model/ContinuouslyPushRequest.cc new file mode 100644 index 000000000..47c0d48be --- /dev/null +++ b/push/src/model/ContinuouslyPushRequest.cc @@ -0,0 +1,82 @@ +/* + * 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::Push::Model::ContinuouslyPushRequest; + +ContinuouslyPushRequest::ContinuouslyPushRequest() : + RpcServiceRequest("push", "2016-08-01", "ContinuouslyPush") +{} + +ContinuouslyPushRequest::~ContinuouslyPushRequest() +{} + +std::string ContinuouslyPushRequest::getMessageId()const +{ + return messageId_; +} + +void ContinuouslyPushRequest::setMessageId(const std::string& messageId) +{ + messageId_ = messageId; + setCoreParameter("MessageId", messageId); +} + +std::string ContinuouslyPushRequest::getAccessKeyId()const +{ + return accessKeyId_; +} + +void ContinuouslyPushRequest::setAccessKeyId(const std::string& accessKeyId) +{ + accessKeyId_ = accessKeyId; + setCoreParameter("AccessKeyId", accessKeyId); +} + +std::string ContinuouslyPushRequest::getTarget()const +{ + return target_; +} + +void ContinuouslyPushRequest::setTarget(const std::string& target) +{ + target_ = target; + setCoreParameter("Target", target); +} + +long ContinuouslyPushRequest::getAppKey()const +{ + return appKey_; +} + +void ContinuouslyPushRequest::setAppKey(long appKey) +{ + appKey_ = appKey; + setCoreParameter("AppKey", std::to_string(appKey)); +} + +std::string ContinuouslyPushRequest::getTargetValue()const +{ + return targetValue_; +} + +void ContinuouslyPushRequest::setTargetValue(const std::string& targetValue) +{ + targetValue_ = targetValue; + setCoreParameter("TargetValue", targetValue); +} + diff --git a/push/src/model/ContinuouslyPushResult.cc b/push/src/model/ContinuouslyPushResult.cc new file mode 100644 index 000000000..86164307e --- /dev/null +++ b/push/src/model/ContinuouslyPushResult.cc @@ -0,0 +1,51 @@ +/* + * 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::Push; +using namespace AlibabaCloud::Push::Model; + +ContinuouslyPushResult::ContinuouslyPushResult() : + ServiceResult() +{} + +ContinuouslyPushResult::ContinuouslyPushResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +ContinuouslyPushResult::~ContinuouslyPushResult() +{} + +void ContinuouslyPushResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + if(!value["MessageId"].isNull()) + messageId_ = value["MessageId"].asString(); + +} + +std::string ContinuouslyPushResult::getMessageId()const +{ + return messageId_; +} +