Live sdk update.

This commit is contained in:
sdk-team
2023-05-16 08:29:48 +00:00
parent a91b82458d
commit 25cf7939ec
20 changed files with 1101 additions and 1 deletions

View File

@@ -1563,6 +1563,42 @@ LiveClient::CreateCustomTemplateOutcomeCallable LiveClient::createCustomTemplate
return task->get_future();
}
LiveClient::CreateEventSubOutcome LiveClient::createEventSub(const CreateEventSubRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return CreateEventSubOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return CreateEventSubOutcome(CreateEventSubResult(outcome.result()));
else
return CreateEventSubOutcome(outcome.error());
}
void LiveClient::createEventSubAsync(const CreateEventSubRequest& request, const CreateEventSubAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, createEventSub(request), context);
};
asyncExecute(new Runnable(fn));
}
LiveClient::CreateEventSubOutcomeCallable LiveClient::createEventSubCallable(const CreateEventSubRequest &request) const
{
auto task = std::make_shared<std::packaged_task<CreateEventSubOutcome()>>(
[this, request]()
{
return this->createEventSub(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
LiveClient::CreateLiveDelayConfigOutcome LiveClient::createLiveDelayConfig(const CreateLiveDelayConfigRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -2175,6 +2211,42 @@ LiveClient::DeleteCustomTemplateOutcomeCallable LiveClient::deleteCustomTemplate
return task->get_future();
}
LiveClient::DeleteEventSubOutcome LiveClient::deleteEventSub(const DeleteEventSubRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return DeleteEventSubOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return DeleteEventSubOutcome(DeleteEventSubResult(outcome.result()));
else
return DeleteEventSubOutcome(outcome.error());
}
void LiveClient::deleteEventSubAsync(const DeleteEventSubRequest& request, const DeleteEventSubAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, deleteEventSub(request), context);
};
asyncExecute(new Runnable(fn));
}
LiveClient::DeleteEventSubOutcomeCallable LiveClient::deleteEventSubCallable(const DeleteEventSubRequest &request) const
{
auto task = std::make_shared<std::packaged_task<DeleteEventSubOutcome()>>(
[this, request]()
{
return this->deleteEventSub(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
LiveClient::DeleteLiveAppRecordConfigOutcome LiveClient::deleteLiveAppRecordConfig(const DeleteLiveAppRecordConfigRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -3867,6 +3939,42 @@ LiveClient::DescribeCastersOutcomeCallable LiveClient::describeCastersCallable(c
return task->get_future();
}
LiveClient::DescribeChannelParticipantsOutcome LiveClient::describeChannelParticipants(const DescribeChannelParticipantsRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return DescribeChannelParticipantsOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return DescribeChannelParticipantsOutcome(DescribeChannelParticipantsResult(outcome.result()));
else
return DescribeChannelParticipantsOutcome(outcome.error());
}
void LiveClient::describeChannelParticipantsAsync(const DescribeChannelParticipantsRequest& request, const DescribeChannelParticipantsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, describeChannelParticipants(request), context);
};
asyncExecute(new Runnable(fn));
}
LiveClient::DescribeChannelParticipantsOutcomeCallable LiveClient::describeChannelParticipantsCallable(const DescribeChannelParticipantsRequest &request) const
{
auto task = std::make_shared<std::packaged_task<DescribeChannelParticipantsOutcome()>>(
[this, request]()
{
return this->describeChannelParticipants(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
LiveClient::DescribeDomainUsageDataOutcome LiveClient::describeDomainUsageData(const DescribeDomainUsageDataRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -9303,6 +9411,42 @@ LiveClient::RemoveShowFromShowListOutcomeCallable LiveClient::removeShowFromShow
return task->get_future();
}
LiveClient::RemoveTerminalsOutcome LiveClient::removeTerminals(const RemoveTerminalsRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return RemoveTerminalsOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return RemoveTerminalsOutcome(RemoveTerminalsResult(outcome.result()));
else
return RemoveTerminalsOutcome(outcome.error());
}
void LiveClient::removeTerminalsAsync(const RemoveTerminalsRequest& request, const RemoveTerminalsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, removeTerminals(request), context);
};
asyncExecute(new Runnable(fn));
}
LiveClient::RemoveTerminalsOutcomeCallable LiveClient::removeTerminalsCallable(const RemoveTerminalsRequest &request) const
{
auto task = std::make_shared<std::packaged_task<RemoveTerminalsOutcome()>>(
[this, request]()
{
return this->removeTerminals(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
LiveClient::RestartCasterOutcome LiveClient::restartCaster(const RestartCasterRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();

View File

@@ -0,0 +1,88 @@
/*
* 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/live/model/CreateEventSubRequest.h>
using AlibabaCloud::Live::Model::CreateEventSubRequest;
CreateEventSubRequest::CreateEventSubRequest()
: RpcServiceRequest("live", "2016-11-01", "CreateEventSub") {
setMethod(HttpRequest::Method::Post);
}
CreateEventSubRequest::~CreateEventSubRequest() {}
int CreateEventSubRequest::getRole() const {
return role_;
}
void CreateEventSubRequest::setRole(int role) {
role_ = role;
setParameter(std::string("Role"), std::to_string(role));
}
std::string CreateEventSubRequest::getClientToken() const {
return clientToken_;
}
void CreateEventSubRequest::setClientToken(const std::string &clientToken) {
clientToken_ = clientToken;
setParameter(std::string("ClientToken"), clientToken);
}
std::vector<std::string> CreateEventSubRequest::getUsers() const {
return users_;
}
void CreateEventSubRequest::setUsers(const std::vector<std::string> &users) {
users_ = users;
}
std::string CreateEventSubRequest::getAppId() const {
return appId_;
}
void CreateEventSubRequest::setAppId(const std::string &appId) {
appId_ = appId;
setParameter(std::string("AppId"), appId);
}
std::string CreateEventSubRequest::getCallbackUrl() const {
return callbackUrl_;
}
void CreateEventSubRequest::setCallbackUrl(const std::string &callbackUrl) {
callbackUrl_ = callbackUrl;
setParameter(std::string("CallbackUrl"), callbackUrl);
}
std::string CreateEventSubRequest::getChannelId() const {
return channelId_;
}
void CreateEventSubRequest::setChannelId(const std::string &channelId) {
channelId_ = channelId;
setParameter(std::string("ChannelId"), channelId);
}
std::vector<std::string> CreateEventSubRequest::getEvents() const {
return events_;
}
void CreateEventSubRequest::setEvents(const std::vector<std::string> &events) {
events_ = events;
}

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/live/model/CreateEventSubResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Live;
using namespace AlibabaCloud::Live::Model;
CreateEventSubResult::CreateEventSubResult() :
ServiceResult()
{}
CreateEventSubResult::CreateEventSubResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
CreateEventSubResult::~CreateEventSubResult()
{}
void CreateEventSubResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
if(!value["SubscribeId"].isNull())
subscribeId_ = value["SubscribeId"].asString();
}
std::string CreateEventSubResult::getSubscribeId()const
{
return subscribeId_;
}

View File

@@ -0,0 +1,45 @@
/*
* 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/live/model/DeleteEventSubRequest.h>
using AlibabaCloud::Live::Model::DeleteEventSubRequest;
DeleteEventSubRequest::DeleteEventSubRequest()
: RpcServiceRequest("live", "2016-11-01", "DeleteEventSub") {
setMethod(HttpRequest::Method::Post);
}
DeleteEventSubRequest::~DeleteEventSubRequest() {}
std::string DeleteEventSubRequest::getSubscribeId() const {
return subscribeId_;
}
void DeleteEventSubRequest::setSubscribeId(const std::string &subscribeId) {
subscribeId_ = subscribeId;
setParameter(std::string("SubscribeId"), subscribeId);
}
std::string DeleteEventSubRequest::getAppId() const {
return appId_;
}
void DeleteEventSubRequest::setAppId(const std::string &appId) {
appId_ = appId;
setParameter(std::string("AppId"), appId);
}

View File

@@ -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 <alibabacloud/live/model/DeleteEventSubResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Live;
using namespace AlibabaCloud::Live::Model;
DeleteEventSubResult::DeleteEventSubResult() :
ServiceResult()
{}
DeleteEventSubResult::DeleteEventSubResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
DeleteEventSubResult::~DeleteEventSubResult()
{}
void DeleteEventSubResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
}

View File

@@ -0,0 +1,72 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <alibabacloud/live/model/DescribeChannelParticipantsRequest.h>
using AlibabaCloud::Live::Model::DescribeChannelParticipantsRequest;
DescribeChannelParticipantsRequest::DescribeChannelParticipantsRequest()
: RpcServiceRequest("live", "2016-11-01", "DescribeChannelParticipants") {
setMethod(HttpRequest::Method::Post);
}
DescribeChannelParticipantsRequest::~DescribeChannelParticipantsRequest() {}
int DescribeChannelParticipantsRequest::getPageNum() const {
return pageNum_;
}
void DescribeChannelParticipantsRequest::setPageNum(int pageNum) {
pageNum_ = pageNum;
setParameter(std::string("PageNum"), std::to_string(pageNum));
}
std::string DescribeChannelParticipantsRequest::getAppId() const {
return appId_;
}
void DescribeChannelParticipantsRequest::setAppId(const std::string &appId) {
appId_ = appId;
setParameter(std::string("AppId"), appId);
}
int DescribeChannelParticipantsRequest::getPageSize() const {
return pageSize_;
}
void DescribeChannelParticipantsRequest::setPageSize(int pageSize) {
pageSize_ = pageSize;
setParameter(std::string("PageSize"), std::to_string(pageSize));
}
std::string DescribeChannelParticipantsRequest::getChannelId() const {
return channelId_;
}
void DescribeChannelParticipantsRequest::setChannelId(const std::string &channelId) {
channelId_ = channelId;
setParameter(std::string("ChannelId"), channelId);
}
std::string DescribeChannelParticipantsRequest::getOrder() const {
return order_;
}
void DescribeChannelParticipantsRequest::setOrder(const std::string &order) {
order_ = order;
setParameter(std::string("Order"), order);
}

View File

@@ -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 <alibabacloud/live/model/DescribeChannelParticipantsResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Live;
using namespace AlibabaCloud::Live::Model;
DescribeChannelParticipantsResult::DescribeChannelParticipantsResult() :
ServiceResult()
{}
DescribeChannelParticipantsResult::DescribeChannelParticipantsResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
DescribeChannelParticipantsResult::~DescribeChannelParticipantsResult()
{}
void DescribeChannelParticipantsResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto allUserList = value["UserList"]["Users"];
for (const auto &item : allUserList)
userList_.push_back(item.asString());
if(!value["TotalPage"].isNull())
totalPage_ = std::stoi(value["TotalPage"].asString());
if(!value["TotalNum"].isNull())
totalNum_ = std::stoi(value["TotalNum"].asString());
if(!value["Times"].isNull())
times_ = std::stol(value["Times"].asString());
}
int DescribeChannelParticipantsResult::getTotalNum()const
{
return totalNum_;
}
int DescribeChannelParticipantsResult::getTotalPage()const
{
return totalPage_;
}
long DescribeChannelParticipantsResult::getTimes()const
{
return times_;
}
std::vector<std::string> DescribeChannelParticipantsResult::getUserList()const
{
return userList_;
}

View File

@@ -0,0 +1,53 @@
/*
* 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/live/model/RemoveTerminalsRequest.h>
using AlibabaCloud::Live::Model::RemoveTerminalsRequest;
RemoveTerminalsRequest::RemoveTerminalsRequest()
: RpcServiceRequest("live", "2016-11-01", "RemoveTerminals") {
setMethod(HttpRequest::Method::Post);
}
RemoveTerminalsRequest::~RemoveTerminalsRequest() {}
std::string RemoveTerminalsRequest::getAppId() const {
return appId_;
}
void RemoveTerminalsRequest::setAppId(const std::string &appId) {
appId_ = appId;
setParameter(std::string("AppId"), appId);
}
std::vector<std::string> RemoveTerminalsRequest::getTerminalIds() const {
return terminalIds_;
}
void RemoveTerminalsRequest::setTerminalIds(const std::vector<std::string> &terminalIds) {
terminalIds_ = terminalIds;
}
std::string RemoveTerminalsRequest::getChannelId() const {
return channelId_;
}
void RemoveTerminalsRequest::setChannelId(const std::string &channelId) {
channelId_ = channelId;
setParameter(std::string("ChannelId"), channelId);
}

View File

@@ -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.
*/
#include <alibabacloud/live/model/RemoveTerminalsResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Live;
using namespace AlibabaCloud::Live::Model;
RemoveTerminalsResult::RemoveTerminalsResult() :
ServiceResult()
{}
RemoveTerminalsResult::RemoveTerminalsResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
RemoveTerminalsResult::~RemoveTerminalsResult()
{}
void RemoveTerminalsResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto allTerminalsNode = value["Terminals"]["Terminal"];
for (auto valueTerminalsTerminal : allTerminalsNode)
{
Terminal terminalsObject;
if(!valueTerminalsTerminal["Code"].isNull())
terminalsObject.code = std::stoi(valueTerminalsTerminal["Code"].asString());
if(!valueTerminalsTerminal["Message"].isNull())
terminalsObject.message = valueTerminalsTerminal["Message"].asString();
if(!valueTerminalsTerminal["Id"].isNull())
terminalsObject.id = valueTerminalsTerminal["Id"].asString();
terminals_.push_back(terminalsObject);
}
}
std::vector<RemoveTerminalsResult::Terminal> RemoveTerminalsResult::getTerminals()const
{
return terminals_;
}