Add DescribeAppKey interface.

This commit is contained in:
sdk-team
2022-05-06 03:27:33 +00:00
parent 278c4950d0
commit db5500f960
11 changed files with 280 additions and 1 deletions

View File

@@ -375,6 +375,42 @@ RtcClient::DeleteRecordTemplateOutcomeCallable RtcClient::deleteRecordTemplateCa
return task->get_future();
}
RtcClient::DescribeAppKeyOutcome RtcClient::describeAppKey(const DescribeAppKeyRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return DescribeAppKeyOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return DescribeAppKeyOutcome(DescribeAppKeyResult(outcome.result()));
else
return DescribeAppKeyOutcome(outcome.error());
}
void RtcClient::describeAppKeyAsync(const DescribeAppKeyRequest& request, const DescribeAppKeyAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, describeAppKey(request), context);
};
asyncExecute(new Runnable(fn));
}
RtcClient::DescribeAppKeyOutcomeCallable RtcClient::describeAppKeyCallable(const DescribeAppKeyRequest &request) const
{
auto task = std::make_shared<std::packaged_task<DescribeAppKeyOutcome()>>(
[this, request]()
{
return this->describeAppKey(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
RtcClient::DescribeAppsOutcome RtcClient::describeApps(const DescribeAppsRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();

View File

@@ -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.
*/
#include <alibabacloud/rtc/model/DescribeAppKeyRequest.h>
using AlibabaCloud::Rtc::Model::DescribeAppKeyRequest;
DescribeAppKeyRequest::DescribeAppKeyRequest()
: RpcServiceRequest("rtc", "2018-01-11", "DescribeAppKey") {
setMethod(HttpRequest::Method::Post);
}
DescribeAppKeyRequest::~DescribeAppKeyRequest() {}
std::string DescribeAppKeyRequest::getShowLog() const {
return showLog_;
}
void DescribeAppKeyRequest::setShowLog(const std::string &showLog) {
showLog_ = showLog;
setParameter(std::string("ShowLog"), showLog);
}
std::string DescribeAppKeyRequest::getQueryAppId() const {
return queryAppId_;
}
void DescribeAppKeyRequest::setQueryAppId(const std::string &queryAppId) {
queryAppId_ = queryAppId;
setParameter(std::string("QueryAppId"), queryAppId);
}
long DescribeAppKeyRequest::getOwnerId() const {
return ownerId_;
}
void DescribeAppKeyRequest::setOwnerId(long ownerId) {
ownerId_ = ownerId;
setParameter(std::string("OwnerId"), std::to_string(ownerId));
}
std::string DescribeAppKeyRequest::getAppId() const {
return appId_;
}
void DescribeAppKeyRequest::setAppId(const std::string &appId) {
appId_ = appId;
setParameter(std::string("AppId"), appId);
}

View File

@@ -0,0 +1,58 @@
/*
* 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/rtc/model/DescribeAppKeyResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Rtc;
using namespace AlibabaCloud::Rtc::Model;
DescribeAppKeyResult::DescribeAppKeyResult() :
ServiceResult()
{}
DescribeAppKeyResult::DescribeAppKeyResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
DescribeAppKeyResult::~DescribeAppKeyResult()
{}
void DescribeAppKeyResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
if(!value["BizId"].isNull())
bizId_ = value["BizId"].asString();
if(!value["AppKey"].isNull())
appKey_ = value["AppKey"].asString();
}
std::string DescribeAppKeyResult::getAppKey()const
{
return appKey_;
}
std::string DescribeAppKeyResult::getBizId()const
{
return bizId_;
}

View File

@@ -55,6 +55,8 @@ void DescribeAppsResult::parse(const std::string &payload)
appListObject.billType = valueAppListApp["BillType"].asString();
if(!valueAppListApp["AppType"].isNull())
appListObject.appType = valueAppListApp["AppType"].asString();
if(!valueAppListApp["Region"].isNull())
appListObject.region = valueAppListApp["Region"].asString();
auto allServiceAreas = value["ServiceAreas"]["ServiceArea"];
for (auto value : allServiceAreas)
appListObject.serviceAreas.push_back(value.asString());