diff --git a/VERSION b/VERSION index 6ec0cd4e7..b301afa57 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.1404 \ No newline at end of file +1.36.1405 \ No newline at end of file diff --git a/live/CMakeLists.txt b/live/CMakeLists.txt index 39da4318e..0c78cbb0b 100644 --- a/live/CMakeLists.txt +++ b/live/CMakeLists.txt @@ -45,6 +45,8 @@ set(live_public_header_model include/alibabacloud/live/model/AddLiveAudioAuditConfigResult.h include/alibabacloud/live/model/AddLiveAudioAuditNotifyConfigRequest.h include/alibabacloud/live/model/AddLiveAudioAuditNotifyConfigResult.h + include/alibabacloud/live/model/AddLiveCenterTransferRequest.h + include/alibabacloud/live/model/AddLiveCenterTransferResult.h include/alibabacloud/live/model/AddLiveDetectNotifyConfigRequest.h include/alibabacloud/live/model/AddLiveDetectNotifyConfigResult.h include/alibabacloud/live/model/AddLiveDomainRequest.h @@ -650,6 +652,8 @@ set(live_src src/model/AddLiveAudioAuditConfigResult.cc src/model/AddLiveAudioAuditNotifyConfigRequest.cc src/model/AddLiveAudioAuditNotifyConfigResult.cc + src/model/AddLiveCenterTransferRequest.cc + src/model/AddLiveCenterTransferResult.cc src/model/AddLiveDetectNotifyConfigRequest.cc src/model/AddLiveDetectNotifyConfigResult.cc src/model/AddLiveDomainRequest.cc diff --git a/live/include/alibabacloud/live/LiveClient.h b/live/include/alibabacloud/live/LiveClient.h index a1db7e9c3..a8ceb0af2 100644 --- a/live/include/alibabacloud/live/LiveClient.h +++ b/live/include/alibabacloud/live/LiveClient.h @@ -46,6 +46,8 @@ #include "model/AddLiveAudioAuditConfigResult.h" #include "model/AddLiveAudioAuditNotifyConfigRequest.h" #include "model/AddLiveAudioAuditNotifyConfigResult.h" +#include "model/AddLiveCenterTransferRequest.h" +#include "model/AddLiveCenterTransferResult.h" #include "model/AddLiveDetectNotifyConfigRequest.h" #include "model/AddLiveDetectNotifyConfigResult.h" #include "model/AddLiveDomainRequest.h" @@ -669,6 +671,9 @@ namespace AlibabaCloud typedef Outcome AddLiveAudioAuditNotifyConfigOutcome; typedef std::future AddLiveAudioAuditNotifyConfigOutcomeCallable; typedef std::function&)> AddLiveAudioAuditNotifyConfigAsyncHandler; + typedef Outcome AddLiveCenterTransferOutcome; + typedef std::future AddLiveCenterTransferOutcomeCallable; + typedef std::function&)> AddLiveCenterTransferAsyncHandler; typedef Outcome AddLiveDetectNotifyConfigOutcome; typedef std::future AddLiveDetectNotifyConfigOutcomeCallable; typedef std::function&)> AddLiveDetectNotifyConfigAsyncHandler; @@ -1577,6 +1582,9 @@ namespace AlibabaCloud AddLiveAudioAuditNotifyConfigOutcome addLiveAudioAuditNotifyConfig(const Model::AddLiveAudioAuditNotifyConfigRequest &request)const; void addLiveAudioAuditNotifyConfigAsync(const Model::AddLiveAudioAuditNotifyConfigRequest& request, const AddLiveAudioAuditNotifyConfigAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; AddLiveAudioAuditNotifyConfigOutcomeCallable addLiveAudioAuditNotifyConfigCallable(const Model::AddLiveAudioAuditNotifyConfigRequest& request) const; + AddLiveCenterTransferOutcome addLiveCenterTransfer(const Model::AddLiveCenterTransferRequest &request)const; + void addLiveCenterTransferAsync(const Model::AddLiveCenterTransferRequest& request, const AddLiveCenterTransferAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + AddLiveCenterTransferOutcomeCallable addLiveCenterTransferCallable(const Model::AddLiveCenterTransferRequest& request) const; AddLiveDetectNotifyConfigOutcome addLiveDetectNotifyConfig(const Model::AddLiveDetectNotifyConfigRequest &request)const; void addLiveDetectNotifyConfigAsync(const Model::AddLiveDetectNotifyConfigRequest& request, const AddLiveDetectNotifyConfigAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; AddLiveDetectNotifyConfigOutcomeCallable addLiveDetectNotifyConfigCallable(const Model::AddLiveDetectNotifyConfigRequest& request) const; diff --git a/live/include/alibabacloud/live/model/AddLiveCenterTransferRequest.h b/live/include/alibabacloud/live/model/AddLiveCenterTransferRequest.h new file mode 100644 index 000000000..ceea5b540 --- /dev/null +++ b/live/include/alibabacloud/live/model/AddLiveCenterTransferRequest.h @@ -0,0 +1,63 @@ +/* + * 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_LIVE_MODEL_ADDLIVECENTERTRANSFERREQUEST_H_ +#define ALIBABACLOUD_LIVE_MODEL_ADDLIVECENTERTRANSFERREQUEST_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud { +namespace Live { +namespace Model { +class ALIBABACLOUD_LIVE_EXPORT AddLiveCenterTransferRequest : public RpcServiceRequest { +public: + AddLiveCenterTransferRequest(); + ~AddLiveCenterTransferRequest(); + std::string getTransferArgs() const; + void setTransferArgs(const std::string &transferArgs); + std::string getStartTime() const; + void setStartTime(const std::string &startTime); + std::string getAppName() const; + void setAppName(const std::string &appName); + std::string getStreamName() const; + void setStreamName(const std::string &streamName); + std::string getDstUrl() const; + void setDstUrl(const std::string &dstUrl); + std::string getDomainName() const; + void setDomainName(const std::string &domainName); + std::string getEndTime() const; + void setEndTime(const std::string &endTime); + long getOwnerId() const; + void setOwnerId(long ownerId); + +private: + std::string transferArgs_; + std::string startTime_; + std::string appName_; + std::string streamName_; + std::string dstUrl_; + std::string domainName_; + std::string endTime_; + long ownerId_; +}; +} // namespace Model +} // namespace Live +} // namespace AlibabaCloud +#endif // !ALIBABACLOUD_LIVE_MODEL_ADDLIVECENTERTRANSFERREQUEST_H_ diff --git a/live/include/alibabacloud/live/model/AddLiveCenterTransferResult.h b/live/include/alibabacloud/live/model/AddLiveCenterTransferResult.h new file mode 100644 index 000000000..834b9ff54 --- /dev/null +++ b/live/include/alibabacloud/live/model/AddLiveCenterTransferResult.h @@ -0,0 +1,49 @@ +/* + * 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_LIVE_MODEL_ADDLIVECENTERTRANSFERRESULT_H_ +#define ALIBABACLOUD_LIVE_MODEL_ADDLIVECENTERTRANSFERRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Live + { + namespace Model + { + class ALIBABACLOUD_LIVE_EXPORT AddLiveCenterTransferResult : public ServiceResult + { + public: + + + AddLiveCenterTransferResult(); + explicit AddLiveCenterTransferResult(const std::string &payload); + ~AddLiveCenterTransferResult(); + + protected: + void parse(const std::string &payload); + private: + + }; + } + } +} +#endif // !ALIBABACLOUD_LIVE_MODEL_ADDLIVECENTERTRANSFERRESULT_H_ \ No newline at end of file diff --git a/live/src/LiveClient.cc b/live/src/LiveClient.cc index b460fb290..e842c0966 100644 --- a/live/src/LiveClient.cc +++ b/live/src/LiveClient.cc @@ -483,6 +483,42 @@ LiveClient::AddLiveAudioAuditNotifyConfigOutcomeCallable LiveClient::addLiveAudi return task->get_future(); } +LiveClient::AddLiveCenterTransferOutcome LiveClient::addLiveCenterTransfer(const AddLiveCenterTransferRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return AddLiveCenterTransferOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return AddLiveCenterTransferOutcome(AddLiveCenterTransferResult(outcome.result())); + else + return AddLiveCenterTransferOutcome(outcome.error()); +} + +void LiveClient::addLiveCenterTransferAsync(const AddLiveCenterTransferRequest& request, const AddLiveCenterTransferAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, addLiveCenterTransfer(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +LiveClient::AddLiveCenterTransferOutcomeCallable LiveClient::addLiveCenterTransferCallable(const AddLiveCenterTransferRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->addLiveCenterTransfer(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + LiveClient::AddLiveDetectNotifyConfigOutcome LiveClient::addLiveDetectNotifyConfig(const AddLiveDetectNotifyConfigRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); diff --git a/live/src/model/AddLiveCenterTransferRequest.cc b/live/src/model/AddLiveCenterTransferRequest.cc new file mode 100644 index 000000000..fd9527d18 --- /dev/null +++ b/live/src/model/AddLiveCenterTransferRequest.cc @@ -0,0 +1,99 @@ +/* + * 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::Live::Model::AddLiveCenterTransferRequest; + +AddLiveCenterTransferRequest::AddLiveCenterTransferRequest() + : RpcServiceRequest("live", "2016-11-01", "AddLiveCenterTransfer") { + setMethod(HttpRequest::Method::Post); +} + +AddLiveCenterTransferRequest::~AddLiveCenterTransferRequest() {} + +std::string AddLiveCenterTransferRequest::getTransferArgs() const { + return transferArgs_; +} + +void AddLiveCenterTransferRequest::setTransferArgs(const std::string &transferArgs) { + transferArgs_ = transferArgs; + setParameter(std::string("TransferArgs"), transferArgs); +} + +std::string AddLiveCenterTransferRequest::getStartTime() const { + return startTime_; +} + +void AddLiveCenterTransferRequest::setStartTime(const std::string &startTime) { + startTime_ = startTime; + setParameter(std::string("StartTime"), startTime); +} + +std::string AddLiveCenterTransferRequest::getAppName() const { + return appName_; +} + +void AddLiveCenterTransferRequest::setAppName(const std::string &appName) { + appName_ = appName; + setParameter(std::string("AppName"), appName); +} + +std::string AddLiveCenterTransferRequest::getStreamName() const { + return streamName_; +} + +void AddLiveCenterTransferRequest::setStreamName(const std::string &streamName) { + streamName_ = streamName; + setParameter(std::string("StreamName"), streamName); +} + +std::string AddLiveCenterTransferRequest::getDstUrl() const { + return dstUrl_; +} + +void AddLiveCenterTransferRequest::setDstUrl(const std::string &dstUrl) { + dstUrl_ = dstUrl; + setParameter(std::string("DstUrl"), dstUrl); +} + +std::string AddLiveCenterTransferRequest::getDomainName() const { + return domainName_; +} + +void AddLiveCenterTransferRequest::setDomainName(const std::string &domainName) { + domainName_ = domainName; + setParameter(std::string("DomainName"), domainName); +} + +std::string AddLiveCenterTransferRequest::getEndTime() const { + return endTime_; +} + +void AddLiveCenterTransferRequest::setEndTime(const std::string &endTime) { + endTime_ = endTime; + setParameter(std::string("EndTime"), endTime); +} + +long AddLiveCenterTransferRequest::getOwnerId() const { + return ownerId_; +} + +void AddLiveCenterTransferRequest::setOwnerId(long ownerId) { + ownerId_ = ownerId; + setParameter(std::string("OwnerId"), std::to_string(ownerId)); +} + diff --git a/live/src/model/AddLiveCenterTransferResult.cc b/live/src/model/AddLiveCenterTransferResult.cc new file mode 100644 index 000000000..3e45f72a8 --- /dev/null +++ b/live/src/model/AddLiveCenterTransferResult.cc @@ -0,0 +1,44 @@ +/* + * 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::Live; +using namespace AlibabaCloud::Live::Model; + +AddLiveCenterTransferResult::AddLiveCenterTransferResult() : + ServiceResult() +{} + +AddLiveCenterTransferResult::AddLiveCenterTransferResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +AddLiveCenterTransferResult::~AddLiveCenterTransferResult() +{} + +void AddLiveCenterTransferResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + +} +