Add result value spanId for GetTrace api.
This commit is contained in:
@@ -51,78 +51,6 @@ XtraceClient::XtraceClient(const std::string & accessKeyId, const std::string &
|
||||
XtraceClient::~XtraceClient()
|
||||
{}
|
||||
|
||||
XtraceClient::CheckServiceLinkedRoleForDeletingOutcome XtraceClient::checkServiceLinkedRoleForDeleting(const CheckServiceLinkedRoleForDeletingRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return CheckServiceLinkedRoleForDeletingOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return CheckServiceLinkedRoleForDeletingOutcome(CheckServiceLinkedRoleForDeletingResult(outcome.result()));
|
||||
else
|
||||
return CheckServiceLinkedRoleForDeletingOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void XtraceClient::checkServiceLinkedRoleForDeletingAsync(const CheckServiceLinkedRoleForDeletingRequest& request, const CheckServiceLinkedRoleForDeletingAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, checkServiceLinkedRoleForDeleting(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
XtraceClient::CheckServiceLinkedRoleForDeletingOutcomeCallable XtraceClient::checkServiceLinkedRoleForDeletingCallable(const CheckServiceLinkedRoleForDeletingRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<CheckServiceLinkedRoleForDeletingOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->checkServiceLinkedRoleForDeleting(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
XtraceClient::GetSamplingOutcome XtraceClient::getSampling(const GetSamplingRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return GetSamplingOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return GetSamplingOutcome(GetSamplingResult(outcome.result()));
|
||||
else
|
||||
return GetSamplingOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void XtraceClient::getSamplingAsync(const GetSamplingRequest& request, const GetSamplingAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, getSampling(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
XtraceClient::GetSamplingOutcomeCallable XtraceClient::getSamplingCallable(const GetSamplingRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<GetSamplingOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->getSampling(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
XtraceClient::GetTagKeyOutcome XtraceClient::getTagKey(const GetTagKeyRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
@@ -483,39 +411,3 @@ XtraceClient::SearchTracesOutcomeCallable XtraceClient::searchTracesCallable(con
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
XtraceClient::UpdateSamplingOutcome XtraceClient::updateSampling(const UpdateSamplingRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return UpdateSamplingOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return UpdateSamplingOutcome(UpdateSamplingResult(outcome.result()));
|
||||
else
|
||||
return UpdateSamplingOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void XtraceClient::updateSamplingAsync(const UpdateSamplingRequest& request, const UpdateSamplingAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, updateSampling(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
XtraceClient::UpdateSamplingOutcomeCallable XtraceClient::updateSamplingCallable(const UpdateSamplingRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<UpdateSamplingOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->updateSampling(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,84 +0,0 @@
|
||||
/*
|
||||
* 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/xtrace/model/CheckServiceLinkedRoleForDeletingRequest.h>
|
||||
|
||||
using AlibabaCloud::Xtrace::Model::CheckServiceLinkedRoleForDeletingRequest;
|
||||
|
||||
CheckServiceLinkedRoleForDeletingRequest::CheckServiceLinkedRoleForDeletingRequest() :
|
||||
RpcServiceRequest("xtrace", "2019-08-08", "CheckServiceLinkedRoleForDeleting")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
CheckServiceLinkedRoleForDeletingRequest::~CheckServiceLinkedRoleForDeletingRequest()
|
||||
{}
|
||||
|
||||
std::string CheckServiceLinkedRoleForDeletingRequest::getSPIRegionId()const
|
||||
{
|
||||
return sPIRegionId_;
|
||||
}
|
||||
|
||||
void CheckServiceLinkedRoleForDeletingRequest::setSPIRegionId(const std::string& sPIRegionId)
|
||||
{
|
||||
sPIRegionId_ = sPIRegionId;
|
||||
setParameter("SPIRegionId", sPIRegionId);
|
||||
}
|
||||
|
||||
std::string CheckServiceLinkedRoleForDeletingRequest::getRegionId()const
|
||||
{
|
||||
return regionId_;
|
||||
}
|
||||
|
||||
void CheckServiceLinkedRoleForDeletingRequest::setRegionId(const std::string& regionId)
|
||||
{
|
||||
regionId_ = regionId;
|
||||
setParameter("RegionId", regionId);
|
||||
}
|
||||
|
||||
std::string CheckServiceLinkedRoleForDeletingRequest::getRoleArn()const
|
||||
{
|
||||
return roleArn_;
|
||||
}
|
||||
|
||||
void CheckServiceLinkedRoleForDeletingRequest::setRoleArn(const std::string& roleArn)
|
||||
{
|
||||
roleArn_ = roleArn;
|
||||
setParameter("RoleArn", roleArn);
|
||||
}
|
||||
|
||||
std::string CheckServiceLinkedRoleForDeletingRequest::getDeletionTaskId()const
|
||||
{
|
||||
return deletionTaskId_;
|
||||
}
|
||||
|
||||
void CheckServiceLinkedRoleForDeletingRequest::setDeletionTaskId(const std::string& deletionTaskId)
|
||||
{
|
||||
deletionTaskId_ = deletionTaskId;
|
||||
setParameter("DeletionTaskId", deletionTaskId);
|
||||
}
|
||||
|
||||
std::string CheckServiceLinkedRoleForDeletingRequest::getServiceName()const
|
||||
{
|
||||
return serviceName_;
|
||||
}
|
||||
|
||||
void CheckServiceLinkedRoleForDeletingRequest::setServiceName(const std::string& serviceName)
|
||||
{
|
||||
serviceName_ = serviceName;
|
||||
setParameter("ServiceName", serviceName);
|
||||
}
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
/*
|
||||
* 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/xtrace/model/CheckServiceLinkedRoleForDeletingResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Xtrace;
|
||||
using namespace AlibabaCloud::Xtrace::Model;
|
||||
|
||||
CheckServiceLinkedRoleForDeletingResult::CheckServiceLinkedRoleForDeletingResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
CheckServiceLinkedRoleForDeletingResult::CheckServiceLinkedRoleForDeletingResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
CheckServiceLinkedRoleForDeletingResult::~CheckServiceLinkedRoleForDeletingResult()
|
||||
{}
|
||||
|
||||
void CheckServiceLinkedRoleForDeletingResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto allRoleUsagesNode = value["RoleUsages"]["RoleUsagesItem"];
|
||||
for (auto valueRoleUsagesRoleUsagesItem : allRoleUsagesNode)
|
||||
{
|
||||
RoleUsagesItem roleUsagesObject;
|
||||
if(!valueRoleUsagesRoleUsagesItem["Region"].isNull())
|
||||
roleUsagesObject.region = valueRoleUsagesRoleUsagesItem["Region"].asString();
|
||||
auto allResources = value["Resources"]["Resources"];
|
||||
for (auto value : allResources)
|
||||
roleUsagesObject.resources.push_back(value.asString());
|
||||
roleUsages_.push_back(roleUsagesObject);
|
||||
}
|
||||
if(!value["Deletable"].isNull())
|
||||
deletable_ = value["Deletable"].asString() == "true";
|
||||
|
||||
}
|
||||
|
||||
bool CheckServiceLinkedRoleForDeletingResult::getDeletable()const
|
||||
{
|
||||
return deletable_;
|
||||
}
|
||||
|
||||
std::vector<CheckServiceLinkedRoleForDeletingResult::RoleUsagesItem> CheckServiceLinkedRoleForDeletingResult::getRoleUsages()const
|
||||
{
|
||||
return roleUsages_;
|
||||
}
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
/*
|
||||
* 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/xtrace/model/GetSamplingRequest.h>
|
||||
|
||||
using AlibabaCloud::Xtrace::Model::GetSamplingRequest;
|
||||
|
||||
GetSamplingRequest::GetSamplingRequest() :
|
||||
RpcServiceRequest("xtrace", "2019-08-08", "GetSampling")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
GetSamplingRequest::~GetSamplingRequest()
|
||||
{}
|
||||
|
||||
std::string GetSamplingRequest::getRegionId()const
|
||||
{
|
||||
return regionId_;
|
||||
}
|
||||
|
||||
void GetSamplingRequest::setRegionId(const std::string& regionId)
|
||||
{
|
||||
regionId_ = regionId;
|
||||
setParameter("RegionId", regionId);
|
||||
}
|
||||
|
||||
std::string GetSamplingRequest::getProxyUserId()const
|
||||
{
|
||||
return proxyUserId_;
|
||||
}
|
||||
|
||||
void GetSamplingRequest::setProxyUserId(const std::string& proxyUserId)
|
||||
{
|
||||
proxyUserId_ = proxyUserId;
|
||||
setParameter("ProxyUserId", proxyUserId);
|
||||
}
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
/*
|
||||
* 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/xtrace/model/GetSamplingResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Xtrace;
|
||||
using namespace AlibabaCloud::Xtrace::Model;
|
||||
|
||||
GetSamplingResult::GetSamplingResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
GetSamplingResult::GetSamplingResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
GetSamplingResult::~GetSamplingResult()
|
||||
{}
|
||||
|
||||
void GetSamplingResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["Data"].isNull())
|
||||
data_ = value["Data"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string GetSamplingResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
@@ -60,3 +60,14 @@ void GetTokenRequest::setProxyUserId(const std::string& proxyUserId)
|
||||
setParameter("ProxyUserId", proxyUserId);
|
||||
}
|
||||
|
||||
bool GetTokenRequest::getIsForce()const
|
||||
{
|
||||
return isForce_;
|
||||
}
|
||||
|
||||
void GetTokenRequest::setIsForce(bool isForce)
|
||||
{
|
||||
isForce_ = isForce;
|
||||
setParameter("IsForce", isForce ? "true" : "false");
|
||||
}
|
||||
|
||||
|
||||
@@ -61,30 +61,34 @@ void GetTraceResult::parse(const std::string &payload)
|
||||
spansObject.resultCode = valueSpansSpan["ResultCode"].asString();
|
||||
if(!valueSpansSpan["HaveStack"].isNull())
|
||||
spansObject.haveStack = valueSpansSpan["HaveStack"].asString() == "true";
|
||||
auto allTagEntryListNode = allSpansNode["TagEntryList"]["TagEntry"];
|
||||
for (auto allSpansNodeTagEntryListTagEntry : allTagEntryListNode)
|
||||
if(!valueSpansSpan["SpanId"].isNull())
|
||||
spansObject.spanId = valueSpansSpan["SpanId"].asString();
|
||||
if(!valueSpansSpan["ParentSpanId"].isNull())
|
||||
spansObject.parentSpanId = valueSpansSpan["ParentSpanId"].asString();
|
||||
auto allTagEntryListNode = valueSpansSpan["TagEntryList"]["TagEntry"];
|
||||
for (auto valueSpansSpanTagEntryListTagEntry : allTagEntryListNode)
|
||||
{
|
||||
Span::TagEntry tagEntryListObject;
|
||||
if(!allSpansNodeTagEntryListTagEntry["Key"].isNull())
|
||||
tagEntryListObject.key = allSpansNodeTagEntryListTagEntry["Key"].asString();
|
||||
if(!allSpansNodeTagEntryListTagEntry["Value"].isNull())
|
||||
tagEntryListObject.value = allSpansNodeTagEntryListTagEntry["Value"].asString();
|
||||
if(!valueSpansSpanTagEntryListTagEntry["Key"].isNull())
|
||||
tagEntryListObject.key = valueSpansSpanTagEntryListTagEntry["Key"].asString();
|
||||
if(!valueSpansSpanTagEntryListTagEntry["Value"].isNull())
|
||||
tagEntryListObject.value = valueSpansSpanTagEntryListTagEntry["Value"].asString();
|
||||
spansObject.tagEntryList.push_back(tagEntryListObject);
|
||||
}
|
||||
auto allLogEventListNode = allSpansNode["LogEventList"]["LogEvent"];
|
||||
for (auto allSpansNodeLogEventListLogEvent : allLogEventListNode)
|
||||
auto allLogEventListNode = valueSpansSpan["LogEventList"]["LogEvent"];
|
||||
for (auto valueSpansSpanLogEventListLogEvent : allLogEventListNode)
|
||||
{
|
||||
Span::LogEvent logEventListObject;
|
||||
if(!allSpansNodeLogEventListLogEvent["Timestamp"].isNull())
|
||||
logEventListObject.timestamp = std::stol(allSpansNodeLogEventListLogEvent["Timestamp"].asString());
|
||||
auto allTagEntryList1Node = allLogEventListNode["TagEntryList"]["TagEntry"];
|
||||
for (auto allLogEventListNodeTagEntryListTagEntry : allTagEntryList1Node)
|
||||
if(!valueSpansSpanLogEventListLogEvent["Timestamp"].isNull())
|
||||
logEventListObject.timestamp = std::stol(valueSpansSpanLogEventListLogEvent["Timestamp"].asString());
|
||||
auto allTagEntryList1Node = valueSpansSpanLogEventListLogEvent["TagEntryList"]["TagEntry"];
|
||||
for (auto valueSpansSpanLogEventListLogEventTagEntryListTagEntry : allTagEntryList1Node)
|
||||
{
|
||||
Span::LogEvent::TagEntry2 tagEntryList1Object;
|
||||
if(!allLogEventListNodeTagEntryListTagEntry["Key"].isNull())
|
||||
tagEntryList1Object.key = allLogEventListNodeTagEntryListTagEntry["Key"].asString();
|
||||
if(!allLogEventListNodeTagEntryListTagEntry["Value"].isNull())
|
||||
tagEntryList1Object.value = allLogEventListNodeTagEntryListTagEntry["Value"].asString();
|
||||
if(!valueSpansSpanLogEventListLogEventTagEntryListTagEntry["Key"].isNull())
|
||||
tagEntryList1Object.key = valueSpansSpanLogEventListLogEventTagEntryListTagEntry["Key"].asString();
|
||||
if(!valueSpansSpanLogEventListLogEventTagEntryListTagEntry["Value"].isNull())
|
||||
tagEntryList1Object.value = valueSpansSpanLogEventListLogEventTagEntryListTagEntry["Value"].asString();
|
||||
logEventListObject.tagEntryList1.push_back(tagEntryList1Object);
|
||||
}
|
||||
spansObject.logEventList.push_back(logEventListObject);
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
/*
|
||||
* 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/xtrace/model/UpdateSamplingRequest.h>
|
||||
|
||||
using AlibabaCloud::Xtrace::Model::UpdateSamplingRequest;
|
||||
|
||||
UpdateSamplingRequest::UpdateSamplingRequest() :
|
||||
RpcServiceRequest("xtrace", "2019-08-08", "UpdateSampling")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
UpdateSamplingRequest::~UpdateSamplingRequest()
|
||||
{}
|
||||
|
||||
std::string UpdateSamplingRequest::getRegionId()const
|
||||
{
|
||||
return regionId_;
|
||||
}
|
||||
|
||||
void UpdateSamplingRequest::setRegionId(const std::string& regionId)
|
||||
{
|
||||
regionId_ = regionId;
|
||||
setParameter("RegionId", regionId);
|
||||
}
|
||||
|
||||
std::string UpdateSamplingRequest::getSampling()const
|
||||
{
|
||||
return sampling_;
|
||||
}
|
||||
|
||||
void UpdateSamplingRequest::setSampling(const std::string& sampling)
|
||||
{
|
||||
sampling_ = sampling;
|
||||
setParameter("Sampling", sampling);
|
||||
}
|
||||
|
||||
std::string UpdateSamplingRequest::getProxyUserId()const
|
||||
{
|
||||
return proxyUserId_;
|
||||
}
|
||||
|
||||
void UpdateSamplingRequest::setProxyUserId(const std::string& proxyUserId)
|
||||
{
|
||||
proxyUserId_ = proxyUserId;
|
||||
setParameter("ProxyUserId", proxyUserId);
|
||||
}
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
/*
|
||||
* 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/xtrace/model/UpdateSamplingResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Xtrace;
|
||||
using namespace AlibabaCloud::Xtrace::Model;
|
||||
|
||||
UpdateSamplingResult::UpdateSamplingResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
UpdateSamplingResult::UpdateSamplingResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
UpdateSamplingResult::~UpdateSamplingResult()
|
||||
{}
|
||||
|
||||
void UpdateSamplingResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["Data"].isNull())
|
||||
data_ = value["Data"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string UpdateSamplingResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user