support query rtc live rooms
This commit is contained in:
@@ -645,6 +645,8 @@ set(live_public_header_model
|
||||
include/alibabacloud/live/model/ListPlaylistResult.h
|
||||
include/alibabacloud/live/model/ListPlaylistItemsRequest.h
|
||||
include/alibabacloud/live/model/ListPlaylistItemsResult.h
|
||||
include/alibabacloud/live/model/ListRTCLiveRoomsRequest.h
|
||||
include/alibabacloud/live/model/ListRTCLiveRoomsResult.h
|
||||
include/alibabacloud/live/model/ListRtcMPUEventSubRecordRequest.h
|
||||
include/alibabacloud/live/model/ListRtcMPUEventSubRecordResult.h
|
||||
include/alibabacloud/live/model/ListRtcMPUTaskDetailRequest.h
|
||||
@@ -1506,6 +1508,8 @@ set(live_src
|
||||
src/model/ListPlaylistResult.cc
|
||||
src/model/ListPlaylistItemsRequest.cc
|
||||
src/model/ListPlaylistItemsResult.cc
|
||||
src/model/ListRTCLiveRoomsRequest.cc
|
||||
src/model/ListRTCLiveRoomsResult.cc
|
||||
src/model/ListRtcMPUEventSubRecordRequest.cc
|
||||
src/model/ListRtcMPUEventSubRecordResult.cc
|
||||
src/model/ListRtcMPUTaskDetailRequest.cc
|
||||
|
||||
@@ -646,6 +646,8 @@
|
||||
#include "model/ListPlaylistResult.h"
|
||||
#include "model/ListPlaylistItemsRequest.h"
|
||||
#include "model/ListPlaylistItemsResult.h"
|
||||
#include "model/ListRTCLiveRoomsRequest.h"
|
||||
#include "model/ListRTCLiveRoomsResult.h"
|
||||
#include "model/ListRtcMPUEventSubRecordRequest.h"
|
||||
#include "model/ListRtcMPUEventSubRecordResult.h"
|
||||
#include "model/ListRtcMPUTaskDetailRequest.h"
|
||||
@@ -1825,6 +1827,9 @@ namespace AlibabaCloud
|
||||
typedef Outcome<Error, Model::ListPlaylistItemsResult> ListPlaylistItemsOutcome;
|
||||
typedef std::future<ListPlaylistItemsOutcome> ListPlaylistItemsOutcomeCallable;
|
||||
typedef std::function<void(const LiveClient*, const Model::ListPlaylistItemsRequest&, const ListPlaylistItemsOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ListPlaylistItemsAsyncHandler;
|
||||
typedef Outcome<Error, Model::ListRTCLiveRoomsResult> ListRTCLiveRoomsOutcome;
|
||||
typedef std::future<ListRTCLiveRoomsOutcome> ListRTCLiveRoomsOutcomeCallable;
|
||||
typedef std::function<void(const LiveClient*, const Model::ListRTCLiveRoomsRequest&, const ListRTCLiveRoomsOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ListRTCLiveRoomsAsyncHandler;
|
||||
typedef Outcome<Error, Model::ListRtcMPUEventSubRecordResult> ListRtcMPUEventSubRecordOutcome;
|
||||
typedef std::future<ListRtcMPUEventSubRecordOutcome> ListRtcMPUEventSubRecordOutcomeCallable;
|
||||
typedef std::function<void(const LiveClient*, const Model::ListRtcMPUEventSubRecordRequest&, const ListRtcMPUEventSubRecordOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ListRtcMPUEventSubRecordAsyncHandler;
|
||||
@@ -3117,6 +3122,9 @@ namespace AlibabaCloud
|
||||
ListPlaylistItemsOutcome listPlaylistItems(const Model::ListPlaylistItemsRequest &request)const;
|
||||
void listPlaylistItemsAsync(const Model::ListPlaylistItemsRequest& request, const ListPlaylistItemsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
ListPlaylistItemsOutcomeCallable listPlaylistItemsCallable(const Model::ListPlaylistItemsRequest& request) const;
|
||||
ListRTCLiveRoomsOutcome listRTCLiveRooms(const Model::ListRTCLiveRoomsRequest &request)const;
|
||||
void listRTCLiveRoomsAsync(const Model::ListRTCLiveRoomsRequest& request, const ListRTCLiveRoomsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
ListRTCLiveRoomsOutcomeCallable listRTCLiveRoomsCallable(const Model::ListRTCLiveRoomsRequest& request) const;
|
||||
ListRtcMPUEventSubRecordOutcome listRtcMPUEventSubRecord(const Model::ListRtcMPUEventSubRecordRequest &request)const;
|
||||
void listRtcMPUEventSubRecordAsync(const Model::ListRtcMPUEventSubRecordRequest& request, const ListRtcMPUEventSubRecordAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
ListRtcMPUEventSubRecordOutcomeCallable listRtcMPUEventSubRecordCallable(const Model::ListRtcMPUEventSubRecordRequest& request) const;
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* 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_LISTRTCLIVEROOMSREQUEST_H_
|
||||
#define ALIBABACLOUD_LIVE_MODEL_LISTRTCLIVEROOMSREQUEST_H_
|
||||
|
||||
#include <alibabacloud/live/LiveExport.h>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
namespace AlibabaCloud {
|
||||
namespace Live {
|
||||
namespace Model {
|
||||
class ALIBABACLOUD_LIVE_EXPORT ListRTCLiveRoomsRequest : public RpcServiceRequest {
|
||||
public:
|
||||
ListRTCLiveRoomsRequest();
|
||||
~ListRTCLiveRoomsRequest();
|
||||
int getPageNo() const;
|
||||
void setPageNo(int pageNo);
|
||||
std::string getAppId() const;
|
||||
void setAppId(const std::string &appId);
|
||||
int getPageSize() const;
|
||||
void setPageSize(int pageSize);
|
||||
|
||||
private:
|
||||
int pageNo_;
|
||||
std::string appId_;
|
||||
int pageSize_;
|
||||
};
|
||||
} // namespace Model
|
||||
} // namespace Live
|
||||
} // namespace AlibabaCloud
|
||||
#endif // !ALIBABACLOUD_LIVE_MODEL_LISTRTCLIVEROOMSREQUEST_H_
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_LIVE_MODEL_LISTRTCLIVEROOMSRESULT_H_
|
||||
#define ALIBABACLOUD_LIVE_MODEL_LISTRTCLIVEROOMSRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/live/LiveExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Live
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_LIVE_EXPORT ListRTCLiveRoomsResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
ListRTCLiveRoomsResult();
|
||||
explicit ListRTCLiveRoomsResult(const std::string &payload);
|
||||
~ListRTCLiveRoomsResult();
|
||||
int getTotal()const;
|
||||
std::vector<std::string> getRooms()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
int total_;
|
||||
std::vector<std::string> rooms_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_LIVE_MODEL_LISTRTCLIVEROOMSRESULT_H_
|
||||
@@ -11283,6 +11283,42 @@ LiveClient::ListPlaylistItemsOutcomeCallable LiveClient::listPlaylistItemsCallab
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
LiveClient::ListRTCLiveRoomsOutcome LiveClient::listRTCLiveRooms(const ListRTCLiveRoomsRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return ListRTCLiveRoomsOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return ListRTCLiveRoomsOutcome(ListRTCLiveRoomsResult(outcome.result()));
|
||||
else
|
||||
return ListRTCLiveRoomsOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void LiveClient::listRTCLiveRoomsAsync(const ListRTCLiveRoomsRequest& request, const ListRTCLiveRoomsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, listRTCLiveRooms(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
LiveClient::ListRTCLiveRoomsOutcomeCallable LiveClient::listRTCLiveRoomsCallable(const ListRTCLiveRoomsRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<ListRTCLiveRoomsOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->listRTCLiveRooms(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
LiveClient::ListRtcMPUEventSubRecordOutcome LiveClient::listRtcMPUEventSubRecord(const ListRtcMPUEventSubRecordRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
|
||||
54
live/src/model/ListRTCLiveRoomsRequest.cc
Normal file
54
live/src/model/ListRTCLiveRoomsRequest.cc
Normal 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.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/live/model/ListRTCLiveRoomsRequest.h>
|
||||
|
||||
using AlibabaCloud::Live::Model::ListRTCLiveRoomsRequest;
|
||||
|
||||
ListRTCLiveRoomsRequest::ListRTCLiveRoomsRequest()
|
||||
: RpcServiceRequest("live", "2016-11-01", "ListRTCLiveRooms") {
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
ListRTCLiveRoomsRequest::~ListRTCLiveRoomsRequest() {}
|
||||
|
||||
int ListRTCLiveRoomsRequest::getPageNo() const {
|
||||
return pageNo_;
|
||||
}
|
||||
|
||||
void ListRTCLiveRoomsRequest::setPageNo(int pageNo) {
|
||||
pageNo_ = pageNo;
|
||||
setParameter(std::string("PageNo"), std::to_string(pageNo));
|
||||
}
|
||||
|
||||
std::string ListRTCLiveRoomsRequest::getAppId() const {
|
||||
return appId_;
|
||||
}
|
||||
|
||||
void ListRTCLiveRoomsRequest::setAppId(const std::string &appId) {
|
||||
appId_ = appId;
|
||||
setParameter(std::string("AppId"), appId);
|
||||
}
|
||||
|
||||
int ListRTCLiveRoomsRequest::getPageSize() const {
|
||||
return pageSize_;
|
||||
}
|
||||
|
||||
void ListRTCLiveRoomsRequest::setPageSize(int pageSize) {
|
||||
pageSize_ = pageSize;
|
||||
setParameter(std::string("PageSize"), std::to_string(pageSize));
|
||||
}
|
||||
|
||||
59
live/src/model/ListRTCLiveRoomsResult.cc
Normal file
59
live/src/model/ListRTCLiveRoomsResult.cc
Normal file
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* 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/ListRTCLiveRoomsResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Live;
|
||||
using namespace AlibabaCloud::Live::Model;
|
||||
|
||||
ListRTCLiveRoomsResult::ListRTCLiveRoomsResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
ListRTCLiveRoomsResult::ListRTCLiveRoomsResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
ListRTCLiveRoomsResult::~ListRTCLiveRoomsResult()
|
||||
{}
|
||||
|
||||
void ListRTCLiveRoomsResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto allRooms = value["Rooms"]["rooms"];
|
||||
for (const auto &item : allRooms)
|
||||
rooms_.push_back(item.asString());
|
||||
if(!value["Total"].isNull())
|
||||
total_ = std::stoi(value["Total"].asString());
|
||||
|
||||
}
|
||||
|
||||
int ListRTCLiveRoomsResult::getTotal()const
|
||||
{
|
||||
return total_;
|
||||
}
|
||||
|
||||
std::vector<std::string> ListRTCLiveRoomsResult::getRooms()const
|
||||
{
|
||||
return rooms_;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user