Update to support new apis.

This commit is contained in:
sdk-team
2024-05-11 03:05:50 +00:00
parent 805659acd5
commit 3177214fec
10 changed files with 349 additions and 1 deletions

View File

@@ -4839,6 +4839,42 @@ LiveClient::DescribeLiveCdnDiagnoseInfoOutcomeCallable LiveClient::describeLiveC
return task->get_future();
}
LiveClient::DescribeLiveCenterStreamRateDataOutcome LiveClient::describeLiveCenterStreamRateData(const DescribeLiveCenterStreamRateDataRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return DescribeLiveCenterStreamRateDataOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return DescribeLiveCenterStreamRateDataOutcome(DescribeLiveCenterStreamRateDataResult(outcome.result()));
else
return DescribeLiveCenterStreamRateDataOutcome(outcome.error());
}
void LiveClient::describeLiveCenterStreamRateDataAsync(const DescribeLiveCenterStreamRateDataRequest& request, const DescribeLiveCenterStreamRateDataAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, describeLiveCenterStreamRateData(request), context);
};
asyncExecute(new Runnable(fn));
}
LiveClient::DescribeLiveCenterStreamRateDataOutcomeCallable LiveClient::describeLiveCenterStreamRateDataCallable(const DescribeLiveCenterStreamRateDataRequest &request) const
{
auto task = std::make_shared<std::packaged_task<DescribeLiveCenterStreamRateDataOutcome()>>(
[this, request]()
{
return this->describeLiveCenterStreamRateData(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
LiveClient::DescribeLiveCenterTransferOutcome LiveClient::describeLiveCenterTransfer(const DescribeLiveCenterTransferRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();

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/DescribeLiveCenterStreamRateDataRequest.h>
using AlibabaCloud::Live::Model::DescribeLiveCenterStreamRateDataRequest;
DescribeLiveCenterStreamRateDataRequest::DescribeLiveCenterStreamRateDataRequest()
: RpcServiceRequest("live", "2016-11-01", "DescribeLiveCenterStreamRateData") {
setMethod(HttpRequest::Method::Post);
}
DescribeLiveCenterStreamRateDataRequest::~DescribeLiveCenterStreamRateDataRequest() {}
std::string DescribeLiveCenterStreamRateDataRequest::getStartTime() const {
return startTime_;
}
void DescribeLiveCenterStreamRateDataRequest::setStartTime(const std::string &startTime) {
startTime_ = startTime;
setParameter(std::string("StartTime"), startTime);
}
std::string DescribeLiveCenterStreamRateDataRequest::getAppName() const {
return appName_;
}
void DescribeLiveCenterStreamRateDataRequest::setAppName(const std::string &appName) {
appName_ = appName;
setParameter(std::string("AppName"), appName);
}
std::string DescribeLiveCenterStreamRateDataRequest::getStreamName() const {
return streamName_;
}
void DescribeLiveCenterStreamRateDataRequest::setStreamName(const std::string &streamName) {
streamName_ = streamName;
setParameter(std::string("StreamName"), streamName);
}
std::string DescribeLiveCenterStreamRateDataRequest::getDomainName() const {
return domainName_;
}
void DescribeLiveCenterStreamRateDataRequest::setDomainName(const std::string &domainName) {
domainName_ = domainName;
setParameter(std::string("DomainName"), domainName);
}
std::string DescribeLiveCenterStreamRateDataRequest::getEndTime() const {
return endTime_;
}
void DescribeLiveCenterStreamRateDataRequest::setEndTime(const std::string &endTime) {
endTime_ = endTime;
setParameter(std::string("EndTime"), endTime);
}

View File

@@ -0,0 +1,65 @@
/*
* 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/DescribeLiveCenterStreamRateDataResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Live;
using namespace AlibabaCloud::Live::Model;
DescribeLiveCenterStreamRateDataResult::DescribeLiveCenterStreamRateDataResult() :
ServiceResult()
{}
DescribeLiveCenterStreamRateDataResult::DescribeLiveCenterStreamRateDataResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
DescribeLiveCenterStreamRateDataResult::~DescribeLiveCenterStreamRateDataResult()
{}
void DescribeLiveCenterStreamRateDataResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto allRateDatasNode = value["RateDatas"]["Data"];
for (auto valueRateDatasData : allRateDatasNode)
{
Data rateDatasObject;
if(!valueRateDatasData["VideoFps"].isNull())
rateDatasObject.videoFps = valueRateDatasData["VideoFps"].asString();
if(!valueRateDatasData["VideoRate"].isNull())
rateDatasObject.videoRate = valueRateDatasData["VideoRate"].asString();
if(!valueRateDatasData["AudioFps"].isNull())
rateDatasObject.audioFps = valueRateDatasData["AudioFps"].asString();
if(!valueRateDatasData["AudioRate"].isNull())
rateDatasObject.audioRate = valueRateDatasData["AudioRate"].asString();
if(!valueRateDatasData["Time"].isNull())
rateDatasObject.time = valueRateDatasData["Time"].asString();
rateDatas_.push_back(rateDatasObject);
}
}
std::vector<DescribeLiveCenterStreamRateDataResult::Data> DescribeLiveCenterStreamRateDataResult::getRateDatas()const
{
return rateDatas_;
}

View File

@@ -39,6 +39,40 @@ void ModifyLiveMessageUserInfoResult::parse(const std::string &payload)
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto allSuccessListNode = value["SuccessList"]["SuccessGroups"];
for (auto valueSuccessListSuccessGroups : allSuccessListNode)
{
SuccessGroups successListObject;
if(!valueSuccessListSuccessGroups["GroupId"].isNull())
successListObject.groupId = valueSuccessListSuccessGroups["GroupId"].asString();
if(!valueSuccessListSuccessGroups["Success"].isNull())
successListObject.success = valueSuccessListSuccessGroups["Success"].asString() == "true";
successList_.push_back(successListObject);
}
auto allFailListNode = value["FailList"]["FailGroups"];
for (auto valueFailListFailGroups : allFailListNode)
{
FailGroups failListObject;
if(!valueFailListFailGroups["GroupId"].isNull())
failListObject.groupId = valueFailListFailGroups["GroupId"].asString();
if(!valueFailListFailGroups["Success"].isNull())
failListObject.success = valueFailListFailGroups["Success"].asString() == "true";
if(!valueFailListFailGroups["Reason"].isNull())
failListObject.reason = valueFailListFailGroups["Reason"].asString();
if(!valueFailListFailGroups["Code"].isNull())
failListObject.code = std::stoi(valueFailListFailGroups["Code"].asString());
failList_.push_back(failListObject);
}
}
std::vector<ModifyLiveMessageUserInfoResult::SuccessGroups> ModifyLiveMessageUserInfoResult::getSuccessList()const
{
return successList_;
}
std::vector<ModifyLiveMessageUserInfoResult::FailGroups> ModifyLiveMessageUserInfoResult::getFailList()const
{
return failList_;
}