Add ListFace-MotorAlgorithmResults API.

This commit is contained in:
sdk-team
2020-07-01 22:37:33 +08:00
parent a57f6ec422
commit 3ee66cb2b2
13 changed files with 824 additions and 1 deletions

View File

@@ -555,6 +555,42 @@ VcsClient::ListDevicesOutcomeCallable VcsClient::listDevicesCallable(const ListD
return task->get_future();
}
VcsClient::ListFaceAlgorithmResultsOutcome VcsClient::listFaceAlgorithmResults(const ListFaceAlgorithmResultsRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return ListFaceAlgorithmResultsOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return ListFaceAlgorithmResultsOutcome(ListFaceAlgorithmResultsResult(outcome.result()));
else
return ListFaceAlgorithmResultsOutcome(outcome.error());
}
void VcsClient::listFaceAlgorithmResultsAsync(const ListFaceAlgorithmResultsRequest& request, const ListFaceAlgorithmResultsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, listFaceAlgorithmResults(request), context);
};
asyncExecute(new Runnable(fn));
}
VcsClient::ListFaceAlgorithmResultsOutcomeCallable VcsClient::listFaceAlgorithmResultsCallable(const ListFaceAlgorithmResultsRequest &request) const
{
auto task = std::make_shared<std::packaged_task<ListFaceAlgorithmResultsOutcome()>>(
[this, request]()
{
return this->listFaceAlgorithmResults(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
VcsClient::ListMetricsOutcome VcsClient::listMetrics(const ListMetricsRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -591,6 +627,42 @@ VcsClient::ListMetricsOutcomeCallable VcsClient::listMetricsCallable(const ListM
return task->get_future();
}
VcsClient::ListMotorAlgorithmResultsOutcome VcsClient::listMotorAlgorithmResults(const ListMotorAlgorithmResultsRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return ListMotorAlgorithmResultsOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return ListMotorAlgorithmResultsOutcome(ListMotorAlgorithmResultsResult(outcome.result()));
else
return ListMotorAlgorithmResultsOutcome(outcome.error());
}
void VcsClient::listMotorAlgorithmResultsAsync(const ListMotorAlgorithmResultsRequest& request, const ListMotorAlgorithmResultsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, listMotorAlgorithmResults(request), context);
};
asyncExecute(new Runnable(fn));
}
VcsClient::ListMotorAlgorithmResultsOutcomeCallable VcsClient::listMotorAlgorithmResultsCallable(const ListMotorAlgorithmResultsRequest &request) const
{
auto task = std::make_shared<std::packaged_task<ListMotorAlgorithmResultsOutcome()>>(
[this, request]()
{
return this->listMotorAlgorithmResults(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
VcsClient::ListPersonsOutcome VcsClient::listPersons(const ListPersonsRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();

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/vcs/model/ListFaceAlgorithmResultsRequest.h>
using AlibabaCloud::Vcs::Model::ListFaceAlgorithmResultsRequest;
ListFaceAlgorithmResultsRequest::ListFaceAlgorithmResultsRequest() :
RpcServiceRequest("vcs", "2020-05-15", "ListFaceAlgorithmResults")
{
setMethod(HttpRequest::Method::Post);
}
ListFaceAlgorithmResultsRequest::~ListFaceAlgorithmResultsRequest()
{}
std::string ListFaceAlgorithmResultsRequest::getAlgorithmType()const
{
return algorithmType_;
}
void ListFaceAlgorithmResultsRequest::setAlgorithmType(const std::string& algorithmType)
{
algorithmType_ = algorithmType;
setBodyParameter("AlgorithmType", algorithmType);
}
std::string ListFaceAlgorithmResultsRequest::getCorpId()const
{
return corpId_;
}
void ListFaceAlgorithmResultsRequest::setCorpId(const std::string& corpId)
{
corpId_ = corpId;
setBodyParameter("CorpId", corpId);
}
std::string ListFaceAlgorithmResultsRequest::getEndTime()const
{
return endTime_;
}
void ListFaceAlgorithmResultsRequest::setEndTime(const std::string& endTime)
{
endTime_ = endTime;
setBodyParameter("EndTime", endTime);
}
std::string ListFaceAlgorithmResultsRequest::getStartTime()const
{
return startTime_;
}
void ListFaceAlgorithmResultsRequest::setStartTime(const std::string& startTime)
{
startTime_ = startTime;
setBodyParameter("StartTime", startTime);
}
std::string ListFaceAlgorithmResultsRequest::getPageNumber()const
{
return pageNumber_;
}
void ListFaceAlgorithmResultsRequest::setPageNumber(const std::string& pageNumber)
{
pageNumber_ = pageNumber;
setBodyParameter("PageNumber", pageNumber);
}
std::string ListFaceAlgorithmResultsRequest::getDataSourceId()const
{
return dataSourceId_;
}
void ListFaceAlgorithmResultsRequest::setDataSourceId(const std::string& dataSourceId)
{
dataSourceId_ = dataSourceId;
setBodyParameter("DataSourceId", dataSourceId);
}
std::string ListFaceAlgorithmResultsRequest::getPageSize()const
{
return pageSize_;
}
void ListFaceAlgorithmResultsRequest::setPageSize(const std::string& pageSize)
{
pageSize_ = pageSize;
setBodyParameter("PageSize", pageSize);
}

View File

@@ -0,0 +1,108 @@
/*
* 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/vcs/model/ListFaceAlgorithmResultsResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Vcs;
using namespace AlibabaCloud::Vcs::Model;
ListFaceAlgorithmResultsResult::ListFaceAlgorithmResultsResult() :
ServiceResult()
{}
ListFaceAlgorithmResultsResult::ListFaceAlgorithmResultsResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
ListFaceAlgorithmResultsResult::~ListFaceAlgorithmResultsResult()
{}
void ListFaceAlgorithmResultsResult::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["PageNumber"].isNull())
data_.pageNumber = std::stoi(dataNode["PageNumber"].asString());
if(!dataNode["PageSize"].isNull())
data_.pageSize = std::stoi(dataNode["PageSize"].asString());
if(!dataNode["TotalCount"].isNull())
data_.totalCount = std::stoi(dataNode["TotalCount"].asString());
if(!dataNode["TotalPage"].isNull())
data_.totalPage = std::stoi(dataNode["TotalPage"].asString());
auto allRecordsNode = dataNode["Records"]["RecordsItem"];
for (auto dataNodeRecordsRecordsItem : allRecordsNode)
{
Data::RecordsItem recordsItemObject;
if(!dataNodeRecordsRecordsItem["FaceId"].isNull())
recordsItemObject.faceId = dataNodeRecordsRecordsItem["FaceId"].asString();
if(!dataNodeRecordsRecordsItem["CorpId"].isNull())
recordsItemObject.corpId = dataNodeRecordsRecordsItem["CorpId"].asString();
if(!dataNodeRecordsRecordsItem["DataSourceId"].isNull())
recordsItemObject.dataSourceId = dataNodeRecordsRecordsItem["DataSourceId"].asString();
if(!dataNodeRecordsRecordsItem["ShotTime"].isNull())
recordsItemObject.shotTime = dataNodeRecordsRecordsItem["ShotTime"].asString();
if(!dataNodeRecordsRecordsItem["GenderCode"].isNull())
recordsItemObject.genderCode = dataNodeRecordsRecordsItem["GenderCode"].asString();
if(!dataNodeRecordsRecordsItem["MinAge"].isNull())
recordsItemObject.minAge = dataNodeRecordsRecordsItem["MinAge"].asString();
if(!dataNodeRecordsRecordsItem["MaxAge"].isNull())
recordsItemObject.maxAge = dataNodeRecordsRecordsItem["MaxAge"].asString();
if(!dataNodeRecordsRecordsItem["CapStyle"].isNull())
recordsItemObject.capStyle = dataNodeRecordsRecordsItem["CapStyle"].asString();
if(!dataNodeRecordsRecordsItem["HairStyle"].isNull())
recordsItemObject.hairStyle = dataNodeRecordsRecordsItem["HairStyle"].asString();
if(!dataNodeRecordsRecordsItem["LeftTopX"].isNull())
recordsItemObject.leftTopX = std::stof(dataNodeRecordsRecordsItem["LeftTopX"].asString());
if(!dataNodeRecordsRecordsItem["LeftTopY"].isNull())
recordsItemObject.leftTopY = std::stof(dataNodeRecordsRecordsItem["LeftTopY"].asString());
if(!dataNodeRecordsRecordsItem["RightBottomX"].isNull())
recordsItemObject.rightBottomX = std::stof(dataNodeRecordsRecordsItem["RightBottomX"].asString());
if(!dataNodeRecordsRecordsItem["RightBottomY"].isNull())
recordsItemObject.rightBottomY = std::stof(dataNodeRecordsRecordsItem["RightBottomY"].asString());
if(!dataNodeRecordsRecordsItem["PicUrlPath"].isNull())
recordsItemObject.picUrlPath = dataNodeRecordsRecordsItem["PicUrlPath"].asString();
if(!dataNodeRecordsRecordsItem["TargetPicUrlPath"].isNull())
recordsItemObject.targetPicUrlPath = dataNodeRecordsRecordsItem["TargetPicUrlPath"].asString();
data_.records.push_back(recordsItemObject);
}
if(!value["Code"].isNull())
code_ = value["Code"].asString();
if(!value["Message"].isNull())
message_ = value["Message"].asString();
}
std::string ListFaceAlgorithmResultsResult::getMessage()const
{
return message_;
}
ListFaceAlgorithmResultsResult::Data ListFaceAlgorithmResultsResult::getData()const
{
return data_;
}
std::string ListFaceAlgorithmResultsResult::getCode()const
{
return code_;
}

View File

@@ -0,0 +1,117 @@
/*
* 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/vcs/model/ListMotorAlgorithmResultsRequest.h>
using AlibabaCloud::Vcs::Model::ListMotorAlgorithmResultsRequest;
ListMotorAlgorithmResultsRequest::ListMotorAlgorithmResultsRequest() :
RpcServiceRequest("vcs", "2020-05-15", "ListMotorAlgorithmResults")
{
setMethod(HttpRequest::Method::Post);
}
ListMotorAlgorithmResultsRequest::~ListMotorAlgorithmResultsRequest()
{}
std::string ListMotorAlgorithmResultsRequest::getAlgorithmType()const
{
return algorithmType_;
}
void ListMotorAlgorithmResultsRequest::setAlgorithmType(const std::string& algorithmType)
{
algorithmType_ = algorithmType;
setBodyParameter("AlgorithmType", algorithmType);
}
std::string ListMotorAlgorithmResultsRequest::getCorpId()const
{
return corpId_;
}
void ListMotorAlgorithmResultsRequest::setCorpId(const std::string& corpId)
{
corpId_ = corpId;
setBodyParameter("CorpId", corpId);
}
std::string ListMotorAlgorithmResultsRequest::getEndTime()const
{
return endTime_;
}
void ListMotorAlgorithmResultsRequest::setEndTime(const std::string& endTime)
{
endTime_ = endTime;
setBodyParameter("EndTime", endTime);
}
std::string ListMotorAlgorithmResultsRequest::getStartTime()const
{
return startTime_;
}
void ListMotorAlgorithmResultsRequest::setStartTime(const std::string& startTime)
{
startTime_ = startTime;
setBodyParameter("StartTime", startTime);
}
std::string ListMotorAlgorithmResultsRequest::getPageNumber()const
{
return pageNumber_;
}
void ListMotorAlgorithmResultsRequest::setPageNumber(const std::string& pageNumber)
{
pageNumber_ = pageNumber;
setBodyParameter("PageNumber", pageNumber);
}
std::string ListMotorAlgorithmResultsRequest::getPlateNumber()const
{
return plateNumber_;
}
void ListMotorAlgorithmResultsRequest::setPlateNumber(const std::string& plateNumber)
{
plateNumber_ = plateNumber;
setBodyParameter("PlateNumber", plateNumber);
}
std::string ListMotorAlgorithmResultsRequest::getDataSourceId()const
{
return dataSourceId_;
}
void ListMotorAlgorithmResultsRequest::setDataSourceId(const std::string& dataSourceId)
{
dataSourceId_ = dataSourceId;
setBodyParameter("DataSourceId", dataSourceId);
}
std::string ListMotorAlgorithmResultsRequest::getPageSize()const
{
return pageSize_;
}
void ListMotorAlgorithmResultsRequest::setPageSize(const std::string& pageSize)
{
pageSize_ = pageSize;
setBodyParameter("PageSize", pageSize);
}

View File

@@ -0,0 +1,100 @@
/*
* 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/vcs/model/ListMotorAlgorithmResultsResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Vcs;
using namespace AlibabaCloud::Vcs::Model;
ListMotorAlgorithmResultsResult::ListMotorAlgorithmResultsResult() :
ServiceResult()
{}
ListMotorAlgorithmResultsResult::ListMotorAlgorithmResultsResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
ListMotorAlgorithmResultsResult::~ListMotorAlgorithmResultsResult()
{}
void ListMotorAlgorithmResultsResult::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["PageNumber"].isNull())
data_.pageNumber = std::stoi(dataNode["PageNumber"].asString());
if(!dataNode["PageSize"].isNull())
data_.pageSize = std::stoi(dataNode["PageSize"].asString());
if(!dataNode["TotalCount"].isNull())
data_.totalCount = std::stoi(dataNode["TotalCount"].asString());
if(!dataNode["TotalPage"].isNull())
data_.totalPage = std::stoi(dataNode["TotalPage"].asString());
auto allRecordsNode = dataNode["Records"]["RecordsItem"];
for (auto dataNodeRecordsRecordsItem : allRecordsNode)
{
Data::RecordsItem recordsItemObject;
if(!dataNodeRecordsRecordsItem["CorpId"].isNull())
recordsItemObject.corpId = dataNodeRecordsRecordsItem["CorpId"].asString();
if(!dataNodeRecordsRecordsItem["DataSourceId"].isNull())
recordsItemObject.dataSourceId = dataNodeRecordsRecordsItem["DataSourceId"].asString();
if(!dataNodeRecordsRecordsItem["LeftTopX"].isNull())
recordsItemObject.leftTopX = std::stof(dataNodeRecordsRecordsItem["LeftTopX"].asString());
if(!dataNodeRecordsRecordsItem["LeftTopY"].isNull())
recordsItemObject.leftTopY = std::stof(dataNodeRecordsRecordsItem["LeftTopY"].asString());
if(!dataNodeRecordsRecordsItem["MotorId"].isNull())
recordsItemObject.motorId = dataNodeRecordsRecordsItem["MotorId"].asString();
if(!dataNodeRecordsRecordsItem["PicUrlPath"].isNull())
recordsItemObject.picUrlPath = dataNodeRecordsRecordsItem["PicUrlPath"].asString();
if(!dataNodeRecordsRecordsItem["PlateNumber"].isNull())
recordsItemObject.plateNumber = dataNodeRecordsRecordsItem["PlateNumber"].asString();
if(!dataNodeRecordsRecordsItem["RightBottomX"].isNull())
recordsItemObject.rightBottomX = std::stof(dataNodeRecordsRecordsItem["RightBottomX"].asString());
if(!dataNodeRecordsRecordsItem["RightBottomY"].isNull())
recordsItemObject.rightBottomY = std::stof(dataNodeRecordsRecordsItem["RightBottomY"].asString());
if(!dataNodeRecordsRecordsItem["ShotTime"].isNull())
recordsItemObject.shotTime = dataNodeRecordsRecordsItem["ShotTime"].asString();
if(!dataNodeRecordsRecordsItem["TargetPicUrlPath"].isNull())
recordsItemObject.targetPicUrlPath = dataNodeRecordsRecordsItem["TargetPicUrlPath"].asString();
data_.records.push_back(recordsItemObject);
}
if(!value["Code"].isNull())
code_ = value["Code"].asString();
if(!value["Message"].isNull())
message_ = value["Message"].asString();
}
std::string ListMotorAlgorithmResultsResult::getMessage()const
{
return message_;
}
ListMotorAlgorithmResultsResult::Data ListMotorAlgorithmResultsResult::getData()const
{
return data_;
}
std::string ListMotorAlgorithmResultsResult::getCode()const
{
return code_;
}