Support continuous pushing.

This commit is contained in:
sdk-team
2019-10-14 14:05:26 +08:00
parent 0dc8a66e75
commit 8fe6dfd981
13 changed files with 560 additions and 1 deletions

View File

@@ -1,3 +1,6 @@
2019-10-14 Version 1.36.149
- Support continuous pushing.
2019-10-09 Version 1.36.148
- Add VideoCancelScan Api.

View File

@@ -1 +1 @@
1.36.148
1.36.149

View File

@@ -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

View File

@@ -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<Error, Model::CheckDevicesResult> CheckDevicesOutcome;
typedef std::future<CheckDevicesOutcome> CheckDevicesOutcomeCallable;
typedef std::function<void(const PushClient*, const Model::CheckDevicesRequest&, const CheckDevicesOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> CheckDevicesAsyncHandler;
typedef Outcome<Error, Model::CompleteContinuouslyPushResult> CompleteContinuouslyPushOutcome;
typedef std::future<CompleteContinuouslyPushOutcome> CompleteContinuouslyPushOutcomeCallable;
typedef std::function<void(const PushClient*, const Model::CompleteContinuouslyPushRequest&, const CompleteContinuouslyPushOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> CompleteContinuouslyPushAsyncHandler;
typedef Outcome<Error, Model::ContinuouslyPushResult> ContinuouslyPushOutcome;
typedef std::future<ContinuouslyPushOutcome> ContinuouslyPushOutcomeCallable;
typedef std::function<void(const PushClient*, const Model::ContinuouslyPushRequest&, const ContinuouslyPushOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ContinuouslyPushAsyncHandler;
typedef Outcome<Error, Model::ListPushRecordsResult> ListPushRecordsOutcome;
typedef std::future<ListPushRecordsOutcome> ListPushRecordsOutcomeCallable;
typedef std::function<void(const PushClient*, const Model::ListPushRecordsRequest&, const ListPushRecordsOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> 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<const AsyncCallerContext>& 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<const AsyncCallerContext>& 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<const AsyncCallerContext>& 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<const AsyncCallerContext>& context = nullptr) const;
ListPushRecordsOutcomeCallable listPushRecordsCallable(const Model::ListPushRecordsRequest& request) const;

View File

@@ -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 <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/push/PushExport.h>
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_

View File

@@ -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 <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/push/PushExport.h>
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_

View File

@@ -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 <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/push/PushExport.h>
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_

View File

@@ -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 <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/push/PushExport.h>
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_

View File

@@ -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<const AsyncCallerContext>& 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<std::packaged_task<CompleteContinuouslyPushOutcome()>>(
[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<const AsyncCallerContext>& 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<std::packaged_task<ContinuouslyPushOutcome()>>(
[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();

View File

@@ -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 <alibabacloud/push/model/CompleteContinuouslyPushRequest.h>
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));
}

View File

@@ -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 <alibabacloud/push/model/CompleteContinuouslyPushResult.h>
#include <json/json.h>
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_;
}

View File

@@ -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 <alibabacloud/push/model/ContinuouslyPushRequest.h>
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);
}

View File

@@ -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 <alibabacloud/push/model/ContinuouslyPushResult.h>
#include <json/json.h>
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_;
}