VideoSearch deploy SDK.

This commit is contained in:
sdk-team
2020-05-09 17:31:25 +08:00
parent 590e1bdfaf
commit 9f2fb5a595
22 changed files with 1487 additions and 1 deletions

View File

@@ -0,0 +1,197 @@
/*
* 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/videosearch/VideosearchClient.h>
#include <alibabacloud/core/SimpleCredentialsProvider.h>
using namespace AlibabaCloud;
using namespace AlibabaCloud::Location;
using namespace AlibabaCloud::Videosearch;
using namespace AlibabaCloud::Videosearch::Model;
namespace
{
const std::string SERVICE_NAME = "videosearch";
}
VideosearchClient::VideosearchClient(const Credentials &credentials, const ClientConfiguration &configuration) :
RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(credentials), configuration)
{
auto locationClient = std::make_shared<LocationClient>(credentials, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
}
VideosearchClient::VideosearchClient(const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) :
RpcServiceClient(SERVICE_NAME, credentialsProvider, configuration)
{
auto locationClient = std::make_shared<LocationClient>(credentialsProvider, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
}
VideosearchClient::VideosearchClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) :
RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(accessKeyId, accessKeySecret), configuration)
{
auto locationClient = std::make_shared<LocationClient>(accessKeyId, accessKeySecret, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
}
VideosearchClient::~VideosearchClient()
{}
VideosearchClient::AddDeletionVideoTaskOutcome VideosearchClient::addDeletionVideoTask(const AddDeletionVideoTaskRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return AddDeletionVideoTaskOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return AddDeletionVideoTaskOutcome(AddDeletionVideoTaskResult(outcome.result()));
else
return AddDeletionVideoTaskOutcome(outcome.error());
}
void VideosearchClient::addDeletionVideoTaskAsync(const AddDeletionVideoTaskRequest& request, const AddDeletionVideoTaskAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, addDeletionVideoTask(request), context);
};
asyncExecute(new Runnable(fn));
}
VideosearchClient::AddDeletionVideoTaskOutcomeCallable VideosearchClient::addDeletionVideoTaskCallable(const AddDeletionVideoTaskRequest &request) const
{
auto task = std::make_shared<std::packaged_task<AddDeletionVideoTaskOutcome()>>(
[this, request]()
{
return this->addDeletionVideoTask(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
VideosearchClient::AddSearchVideoTaskOutcome VideosearchClient::addSearchVideoTask(const AddSearchVideoTaskRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return AddSearchVideoTaskOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return AddSearchVideoTaskOutcome(AddSearchVideoTaskResult(outcome.result()));
else
return AddSearchVideoTaskOutcome(outcome.error());
}
void VideosearchClient::addSearchVideoTaskAsync(const AddSearchVideoTaskRequest& request, const AddSearchVideoTaskAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, addSearchVideoTask(request), context);
};
asyncExecute(new Runnable(fn));
}
VideosearchClient::AddSearchVideoTaskOutcomeCallable VideosearchClient::addSearchVideoTaskCallable(const AddSearchVideoTaskRequest &request) const
{
auto task = std::make_shared<std::packaged_task<AddSearchVideoTaskOutcome()>>(
[this, request]()
{
return this->addSearchVideoTask(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
VideosearchClient::AddStorageVideoTaskOutcome VideosearchClient::addStorageVideoTask(const AddStorageVideoTaskRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return AddStorageVideoTaskOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return AddStorageVideoTaskOutcome(AddStorageVideoTaskResult(outcome.result()));
else
return AddStorageVideoTaskOutcome(outcome.error());
}
void VideosearchClient::addStorageVideoTaskAsync(const AddStorageVideoTaskRequest& request, const AddStorageVideoTaskAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, addStorageVideoTask(request), context);
};
asyncExecute(new Runnable(fn));
}
VideosearchClient::AddStorageVideoTaskOutcomeCallable VideosearchClient::addStorageVideoTaskCallable(const AddStorageVideoTaskRequest &request) const
{
auto task = std::make_shared<std::packaged_task<AddStorageVideoTaskOutcome()>>(
[this, request]()
{
return this->addStorageVideoTask(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
VideosearchClient::GetTaskStatusOutcome VideosearchClient::getTaskStatus(const GetTaskStatusRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return GetTaskStatusOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return GetTaskStatusOutcome(GetTaskStatusResult(outcome.result()));
else
return GetTaskStatusOutcome(outcome.error());
}
void VideosearchClient::getTaskStatusAsync(const GetTaskStatusRequest& request, const GetTaskStatusAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, getTaskStatus(request), context);
};
asyncExecute(new Runnable(fn));
}
VideosearchClient::GetTaskStatusOutcomeCallable VideosearchClient::getTaskStatusCallable(const GetTaskStatusRequest &request) const
{
auto task = std::make_shared<std::packaged_task<GetTaskStatusOutcome()>>(
[this, request]()
{
return this->getTaskStatus(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}

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/videosearch/model/AddDeletionVideoTaskRequest.h>
using AlibabaCloud::Videosearch::Model::AddDeletionVideoTaskRequest;
AddDeletionVideoTaskRequest::AddDeletionVideoTaskRequest() :
RpcServiceRequest("videosearch", "2020-02-25", "AddDeletionVideoTask")
{
setMethod(HttpRequest::Method::Post);
}
AddDeletionVideoTaskRequest::~AddDeletionVideoTaskRequest()
{}
std::string AddDeletionVideoTaskRequest::getClientToken()const
{
return clientToken_;
}
void AddDeletionVideoTaskRequest::setClientToken(const std::string& clientToken)
{
clientToken_ = clientToken;
setParameter("ClientToken", clientToken);
}
std::string AddDeletionVideoTaskRequest::getVideoId()const
{
return videoId_;
}
void AddDeletionVideoTaskRequest::setVideoId(const std::string& videoId)
{
videoId_ = videoId;
setBodyParameter("VideoId", videoId);
}
std::string AddDeletionVideoTaskRequest::getInstanceId()const
{
return instanceId_;
}
void AddDeletionVideoTaskRequest::setInstanceId(const std::string& instanceId)
{
instanceId_ = instanceId;
setBodyParameter("InstanceId", instanceId);
}
std::string AddDeletionVideoTaskRequest::getRegionId()const
{
return regionId_;
}
void AddDeletionVideoTaskRequest::setRegionId(const std::string& regionId)
{
regionId_ = regionId;
setParameter("RegionId", regionId);
}

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/videosearch/model/AddDeletionVideoTaskResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Videosearch;
using namespace AlibabaCloud::Videosearch::Model;
AddDeletionVideoTaskResult::AddDeletionVideoTaskResult() :
ServiceResult()
{}
AddDeletionVideoTaskResult::AddDeletionVideoTaskResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
AddDeletionVideoTaskResult::~AddDeletionVideoTaskResult()
{}
void AddDeletionVideoTaskResult::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() == "true";
}
bool AddDeletionVideoTaskResult::getData()const
{
return data_;
}

View File

@@ -0,0 +1,150 @@
/*
* 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/videosearch/model/AddSearchVideoTaskRequest.h>
using AlibabaCloud::Videosearch::Model::AddSearchVideoTaskRequest;
AddSearchVideoTaskRequest::AddSearchVideoTaskRequest() :
RpcServiceRequest("videosearch", "2020-02-25", "AddSearchVideoTask")
{
setMethod(HttpRequest::Method::Post);
}
AddSearchVideoTaskRequest::~AddSearchVideoTaskRequest()
{}
std::string AddSearchVideoTaskRequest::getClientToken()const
{
return clientToken_;
}
void AddSearchVideoTaskRequest::setClientToken(const std::string& clientToken)
{
clientToken_ = clientToken;
setParameter("ClientToken", clientToken);
}
int AddSearchVideoTaskRequest::getStorageType()const
{
return storageType_;
}
void AddSearchVideoTaskRequest::setStorageType(int storageType)
{
storageType_ = storageType;
setBodyParameter("StorageType", std::to_string(storageType));
}
std::string AddSearchVideoTaskRequest::getRegionId()const
{
return regionId_;
}
void AddSearchVideoTaskRequest::setRegionId(const std::string& regionId)
{
regionId_ = regionId;
setParameter("RegionId", regionId);
}
std::string AddSearchVideoTaskRequest::getVideoTags()const
{
return videoTags_;
}
void AddSearchVideoTaskRequest::setVideoTags(const std::string& videoTags)
{
videoTags_ = videoTags;
setBodyParameter("VideoTags", videoTags);
}
int AddSearchVideoTaskRequest::getReturnVideoNumber()const
{
return returnVideoNumber_;
}
void AddSearchVideoTaskRequest::setReturnVideoNumber(int returnVideoNumber)
{
returnVideoNumber_ = returnVideoNumber;
setBodyParameter("ReturnVideoNumber", std::to_string(returnVideoNumber));
}
std::string AddSearchVideoTaskRequest::getVideoId()const
{
return videoId_;
}
void AddSearchVideoTaskRequest::setVideoId(const std::string& videoId)
{
videoId_ = videoId;
setBodyParameter("VideoId", videoId);
}
float AddSearchVideoTaskRequest::getReplaceStorageThreshold()const
{
return replaceStorageThreshold_;
}
void AddSearchVideoTaskRequest::setReplaceStorageThreshold(float replaceStorageThreshold)
{
replaceStorageThreshold_ = replaceStorageThreshold;
setBodyParameter("ReplaceStorageThreshold", std::to_string(replaceStorageThreshold));
}
std::string AddSearchVideoTaskRequest::getInstanceId()const
{
return instanceId_;
}
void AddSearchVideoTaskRequest::setInstanceId(const std::string& instanceId)
{
instanceId_ = instanceId;
setBodyParameter("InstanceId", instanceId);
}
std::string AddSearchVideoTaskRequest::getVideoUrl()const
{
return videoUrl_;
}
void AddSearchVideoTaskRequest::setVideoUrl(const std::string& videoUrl)
{
videoUrl_ = videoUrl;
setBodyParameter("VideoUrl", videoUrl);
}
std::string AddSearchVideoTaskRequest::getQueryTags()const
{
return queryTags_;
}
void AddSearchVideoTaskRequest::setQueryTags(const std::string& queryTags)
{
queryTags_ = queryTags;
setBodyParameter("QueryTags", queryTags);
}
std::string AddSearchVideoTaskRequest::getCallbackUrl()const
{
return callbackUrl_;
}
void AddSearchVideoTaskRequest::setCallbackUrl(const std::string& callbackUrl)
{
callbackUrl_ = callbackUrl;
setBodyParameter("CallbackUrl", callbackUrl);
}

View File

@@ -0,0 +1,52 @@
/*
* 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/videosearch/model/AddSearchVideoTaskResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Videosearch;
using namespace AlibabaCloud::Videosearch::Model;
AddSearchVideoTaskResult::AddSearchVideoTaskResult() :
ServiceResult()
{}
AddSearchVideoTaskResult::AddSearchVideoTaskResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
AddSearchVideoTaskResult::~AddSearchVideoTaskResult()
{}
void AddSearchVideoTaskResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto dataNode = value["Data"];
if(!dataNode["TaskId"].isNull())
data_.taskId = dataNode["TaskId"].asString();
}
AddSearchVideoTaskResult::Data AddSearchVideoTaskResult::getData()const
{
return data_;
}

View File

@@ -0,0 +1,106 @@
/*
* 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/videosearch/model/AddStorageVideoTaskRequest.h>
using AlibabaCloud::Videosearch::Model::AddStorageVideoTaskRequest;
AddStorageVideoTaskRequest::AddStorageVideoTaskRequest() :
RpcServiceRequest("videosearch", "2020-02-25", "AddStorageVideoTask")
{
setMethod(HttpRequest::Method::Post);
}
AddStorageVideoTaskRequest::~AddStorageVideoTaskRequest()
{}
std::string AddStorageVideoTaskRequest::getClientToken()const
{
return clientToken_;
}
void AddStorageVideoTaskRequest::setClientToken(const std::string& clientToken)
{
clientToken_ = clientToken;
setParameter("ClientToken", clientToken);
}
std::string AddStorageVideoTaskRequest::getRegionId()const
{
return regionId_;
}
void AddStorageVideoTaskRequest::setRegionId(const std::string& regionId)
{
regionId_ = regionId;
setParameter("RegionId", regionId);
}
std::string AddStorageVideoTaskRequest::getVideoTags()const
{
return videoTags_;
}
void AddStorageVideoTaskRequest::setVideoTags(const std::string& videoTags)
{
videoTags_ = videoTags;
setBodyParameter("VideoTags", videoTags);
}
std::string AddStorageVideoTaskRequest::getVideoId()const
{
return videoId_;
}
void AddStorageVideoTaskRequest::setVideoId(const std::string& videoId)
{
videoId_ = videoId;
setBodyParameter("VideoId", videoId);
}
std::string AddStorageVideoTaskRequest::getInstanceId()const
{
return instanceId_;
}
void AddStorageVideoTaskRequest::setInstanceId(const std::string& instanceId)
{
instanceId_ = instanceId;
setBodyParameter("InstanceId", instanceId);
}
std::string AddStorageVideoTaskRequest::getVideoUrl()const
{
return videoUrl_;
}
void AddStorageVideoTaskRequest::setVideoUrl(const std::string& videoUrl)
{
videoUrl_ = videoUrl;
setBodyParameter("VideoUrl", videoUrl);
}
std::string AddStorageVideoTaskRequest::getCallbackUrl()const
{
return callbackUrl_;
}
void AddStorageVideoTaskRequest::setCallbackUrl(const std::string& callbackUrl)
{
callbackUrl_ = callbackUrl;
setBodyParameter("CallbackUrl", callbackUrl);
}

View File

@@ -0,0 +1,52 @@
/*
* 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/videosearch/model/AddStorageVideoTaskResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Videosearch;
using namespace AlibabaCloud::Videosearch::Model;
AddStorageVideoTaskResult::AddStorageVideoTaskResult() :
ServiceResult()
{}
AddStorageVideoTaskResult::AddStorageVideoTaskResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
AddStorageVideoTaskResult::~AddStorageVideoTaskResult()
{}
void AddStorageVideoTaskResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto dataNode = value["Data"];
if(!dataNode["TaskId"].isNull())
data_.taskId = dataNode["TaskId"].asString();
}
AddStorageVideoTaskResult::Data AddStorageVideoTaskResult::getData()const
{
return data_;
}

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/videosearch/model/GetTaskStatusRequest.h>
using AlibabaCloud::Videosearch::Model::GetTaskStatusRequest;
GetTaskStatusRequest::GetTaskStatusRequest() :
RpcServiceRequest("videosearch", "2020-02-25", "GetTaskStatus")
{
setMethod(HttpRequest::Method::Post);
}
GetTaskStatusRequest::~GetTaskStatusRequest()
{}
std::string GetTaskStatusRequest::getClientToken()const
{
return clientToken_;
}
void GetTaskStatusRequest::setClientToken(const std::string& clientToken)
{
clientToken_ = clientToken;
setParameter("ClientToken", clientToken);
}
std::string GetTaskStatusRequest::getInstanceId()const
{
return instanceId_;
}
void GetTaskStatusRequest::setInstanceId(const std::string& instanceId)
{
instanceId_ = instanceId;
setBodyParameter("InstanceId", instanceId);
}
std::string GetTaskStatusRequest::getRegionId()const
{
return regionId_;
}
void GetTaskStatusRequest::setRegionId(const std::string& regionId)
{
regionId_ = regionId;
setParameter("RegionId", regionId);
}
std::string GetTaskStatusRequest::getTaskId()const
{
return taskId_;
}
void GetTaskStatusRequest::setTaskId(const std::string& taskId)
{
taskId_ = taskId;
setBodyParameter("TaskId", taskId);
}

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/videosearch/model/GetTaskStatusResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Videosearch;
using namespace AlibabaCloud::Videosearch::Model;
GetTaskStatusResult::GetTaskStatusResult() :
ServiceResult()
{}
GetTaskStatusResult::GetTaskStatusResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
GetTaskStatusResult::~GetTaskStatusResult()
{}
void GetTaskStatusResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
if(!value["Data"].isNull())
data_ = std::stoi(value["Data"].asString());
}
int GetTaskStatusResult::getData()const
{
return data_;
}