Release ExtractFingerPrint.
This commit is contained in:
@@ -1059,6 +1059,42 @@ FacebodyClient::EnhanceFaceOutcomeCallable FacebodyClient::enhanceFaceCallable(c
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
FacebodyClient::ExtractFingerPrintOutcome FacebodyClient::extractFingerPrint(const ExtractFingerPrintRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return ExtractFingerPrintOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return ExtractFingerPrintOutcome(ExtractFingerPrintResult(outcome.result()));
|
||||
else
|
||||
return ExtractFingerPrintOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void FacebodyClient::extractFingerPrintAsync(const ExtractFingerPrintRequest& request, const ExtractFingerPrintAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, extractFingerPrint(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
FacebodyClient::ExtractFingerPrintOutcomeCallable FacebodyClient::extractFingerPrintCallable(const ExtractFingerPrintRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<ExtractFingerPrintOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->extractFingerPrint(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
FacebodyClient::ExtractPedestrianFeatureAttrOutcome FacebodyClient::extractPedestrianFeatureAttr(const ExtractPedestrianFeatureAttrRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
|
||||
@@ -42,10 +42,10 @@ void AddFaceImageTemplateResult::parse(const std::string &payload)
|
||||
auto dataNode = value["Data"];
|
||||
if(!dataNode["TemplateId"].isNull())
|
||||
data_.templateId = dataNode["TemplateId"].asString();
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
if(!value["Code"].isNull())
|
||||
code_ = value["Code"].asString();
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -39,10 +39,10 @@ void DeleteFaceImageTemplateResult::parse(const std::string &payload)
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
if(!value["Code"].isNull())
|
||||
code_ = value["Code"].asString();
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -40,22 +40,22 @@ void DetectPedestrianIntrusionResult::parse(const std::string &payload)
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
if(!dataNode["ImageHeight"].isNull())
|
||||
data_.imageHeight = std::stol(dataNode["ImageHeight"].asString());
|
||||
if(!dataNode["ImageWidth"].isNull())
|
||||
data_.imageWidth = std::stol(dataNode["ImageWidth"].asString());
|
||||
if(!dataNode["ImageHeight"].isNull())
|
||||
data_.imageHeight = std::stol(dataNode["ImageHeight"].asString());
|
||||
auto allElementsNode = dataNode["Elements"]["ElementsItem"];
|
||||
for (auto dataNodeElementsElementsItem : allElementsNode)
|
||||
{
|
||||
Data::ElementsItem elementsItemObject;
|
||||
if(!dataNodeElementsElementsItem["BoxId"].isNull())
|
||||
elementsItemObject.boxId = std::stol(dataNodeElementsElementsItem["BoxId"].asString());
|
||||
if(!dataNodeElementsElementsItem["Type"].isNull())
|
||||
elementsItemObject.type = dataNodeElementsElementsItem["Type"].asString();
|
||||
if(!dataNodeElementsElementsItem["Score"].isNull())
|
||||
elementsItemObject.score = std::stol(dataNodeElementsElementsItem["Score"].asString());
|
||||
if(!dataNodeElementsElementsItem["Type"].isNull())
|
||||
elementsItemObject.type = dataNodeElementsElementsItem["Type"].asString();
|
||||
if(!dataNodeElementsElementsItem["IsIntrude"].isNull())
|
||||
elementsItemObject.isIntrude = dataNodeElementsElementsItem["IsIntrude"].asString() == "true";
|
||||
if(!dataNodeElementsElementsItem["BoxId"].isNull())
|
||||
elementsItemObject.boxId = std::stol(dataNodeElementsElementsItem["BoxId"].asString());
|
||||
auto boxNode = value["Box"];
|
||||
if(!boxNode["Left"].isNull())
|
||||
elementsItemObject.box.left = std::stol(boxNode["Left"].asString());
|
||||
@@ -67,10 +67,10 @@ void DetectPedestrianIntrusionResult::parse(const std::string &payload)
|
||||
elementsItemObject.box.bottom = std::stol(boxNode["Bottom"].asString());
|
||||
data_.elements.push_back(elementsItemObject);
|
||||
}
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
if(!value["Code"].isNull())
|
||||
code_ = value["Code"].asString();
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
|
||||
}
|
||||
|
||||
|
||||
51
facebody/src/model/ExtractFingerPrintRequest.cc
Normal file
51
facebody/src/model/ExtractFingerPrintRequest.cc
Normal 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/facebody/model/ExtractFingerPrintRequest.h>
|
||||
|
||||
using AlibabaCloud::Facebody::Model::ExtractFingerPrintRequest;
|
||||
|
||||
ExtractFingerPrintRequest::ExtractFingerPrintRequest() :
|
||||
RpcServiceRequest("facebody", "2019-12-30", "ExtractFingerPrint")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
ExtractFingerPrintRequest::~ExtractFingerPrintRequest()
|
||||
{}
|
||||
|
||||
std::string ExtractFingerPrintRequest::getImageData()const
|
||||
{
|
||||
return imageData_;
|
||||
}
|
||||
|
||||
void ExtractFingerPrintRequest::setImageData(const std::string& imageData)
|
||||
{
|
||||
imageData_ = imageData;
|
||||
setBodyParameter("ImageData", imageData);
|
||||
}
|
||||
|
||||
std::string ExtractFingerPrintRequest::getImageURL()const
|
||||
{
|
||||
return imageURL_;
|
||||
}
|
||||
|
||||
void ExtractFingerPrintRequest::setImageURL(const std::string& imageURL)
|
||||
{
|
||||
imageURL_ = imageURL;
|
||||
setBodyParameter("ImageURL", imageURL);
|
||||
}
|
||||
|
||||
66
facebody/src/model/ExtractFingerPrintResult.cc
Normal file
66
facebody/src/model/ExtractFingerPrintResult.cc
Normal file
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* 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/facebody/model/ExtractFingerPrintResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Facebody;
|
||||
using namespace AlibabaCloud::Facebody::Model;
|
||||
|
||||
ExtractFingerPrintResult::ExtractFingerPrintResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
ExtractFingerPrintResult::ExtractFingerPrintResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
ExtractFingerPrintResult::~ExtractFingerPrintResult()
|
||||
{}
|
||||
|
||||
void ExtractFingerPrintResult::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["FingerPrint"].isNull())
|
||||
data_.fingerPrint = dataNode["FingerPrint"].asString();
|
||||
if(!value["Code"].isNull())
|
||||
code_ = value["Code"].asString();
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string ExtractFingerPrintResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
ExtractFingerPrintResult::Data ExtractFingerPrintResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
std::string ExtractFingerPrintResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
@@ -27,6 +27,17 @@ GenerateHumanSketchStyleRequest::GenerateHumanSketchStyleRequest() :
|
||||
GenerateHumanSketchStyleRequest::~GenerateHumanSketchStyleRequest()
|
||||
{}
|
||||
|
||||
std::string GenerateHumanSketchStyleRequest::getReturnType()const
|
||||
{
|
||||
return returnType_;
|
||||
}
|
||||
|
||||
void GenerateHumanSketchStyleRequest::setReturnType(const std::string& returnType)
|
||||
{
|
||||
returnType_ = returnType;
|
||||
setBodyParameter("ReturnType", returnType);
|
||||
}
|
||||
|
||||
std::string GenerateHumanSketchStyleRequest::getImageURL()const
|
||||
{
|
||||
return imageURL_;
|
||||
|
||||
@@ -42,10 +42,10 @@ void GenerateHumanSketchStyleResult::parse(const std::string &payload)
|
||||
auto dataNode = value["Data"];
|
||||
if(!dataNode["ImageURL"].isNull())
|
||||
data_.imageURL = dataNode["ImageURL"].asString();
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
if(!value["Code"].isNull())
|
||||
code_ = value["Code"].asString();
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -27,17 +27,6 @@ GetRealPersonVerificationResultRequest::GetRealPersonVerificationResultRequest()
|
||||
GetRealPersonVerificationResultRequest::~GetRealPersonVerificationResultRequest()
|
||||
{}
|
||||
|
||||
std::string GetRealPersonVerificationResultRequest::getVerificationToken()const
|
||||
{
|
||||
return verificationToken_;
|
||||
}
|
||||
|
||||
void GetRealPersonVerificationResultRequest::setVerificationToken(const std::string& verificationToken)
|
||||
{
|
||||
verificationToken_ = verificationToken;
|
||||
setBodyParameter("VerificationToken", verificationToken);
|
||||
}
|
||||
|
||||
std::string GetRealPersonVerificationResultRequest::getMaterialHash()const
|
||||
{
|
||||
return materialHash_;
|
||||
@@ -49,3 +38,14 @@ void GetRealPersonVerificationResultRequest::setMaterialHash(const std::string&
|
||||
setBodyParameter("MaterialHash", materialHash);
|
||||
}
|
||||
|
||||
std::string GetRealPersonVerificationResultRequest::getVerificationToken()const
|
||||
{
|
||||
return verificationToken_;
|
||||
}
|
||||
|
||||
void GetRealPersonVerificationResultRequest::setVerificationToken(const std::string& verificationToken)
|
||||
{
|
||||
verificationToken_ = verificationToken;
|
||||
setBodyParameter("VerificationToken", verificationToken);
|
||||
}
|
||||
|
||||
|
||||
@@ -40,16 +40,16 @@ void GetRealPersonVerificationResultResult::parse(const std::string &payload)
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
if(!dataNode["Pass"].isNull())
|
||||
data_.pass = dataNode["Pass"].asString() == "true";
|
||||
if(!dataNode["MaterialMatch"].isNull())
|
||||
data_.materialMatch = dataNode["MaterialMatch"].asString();
|
||||
if(!dataNode["Passed"].isNull())
|
||||
data_.passed = dataNode["Passed"].asString() == "true";
|
||||
if(!dataNode["IdentityInfo"].isNull())
|
||||
data_.identityInfo = dataNode["IdentityInfo"].asString();
|
||||
if(!value["Code"].isNull())
|
||||
code_ = value["Code"].asString();
|
||||
if(!dataNode["MaterialMatch"].isNull())
|
||||
data_.materialMatch = dataNode["MaterialMatch"].asString();
|
||||
if(!value["ErrorMessage"].isNull())
|
||||
errorMessage_ = value["ErrorMessage"].asString();
|
||||
if(!value["Code"].isNull())
|
||||
code_ = value["Code"].asString();
|
||||
if(!value["Success"].isNull())
|
||||
success_ = value["Success"].asString() == "true";
|
||||
|
||||
|
||||
@@ -42,10 +42,10 @@ void MergeImageFaceResult::parse(const std::string &payload)
|
||||
auto dataNode = value["Data"];
|
||||
if(!dataNode["ImageURL"].isNull())
|
||||
data_.imageURL = dataNode["ImageURL"].asString();
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
if(!value["Code"].isNull())
|
||||
code_ = value["Code"].asString();
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -44,19 +44,6 @@ void MonitorExaminationResult::parse(const std::string &payload)
|
||||
data_.chatScore = std::stof(dataNode["ChatScore"].asString());
|
||||
if(!dataNode["Threshold"].isNull())
|
||||
data_.threshold = std::stof(dataNode["Threshold"].asString());
|
||||
auto personInfoNode = dataNode["PersonInfo"];
|
||||
if(!personInfoNode["PersonNumber"].isNull())
|
||||
data_.personInfo.personNumber = std::stol(personInfoNode["PersonNumber"].asString());
|
||||
auto earPhoneNode = personInfoNode["EarPhone"];
|
||||
if(!earPhoneNode["Score"].isNull())
|
||||
data_.personInfo.earPhone.score = std::stof(earPhoneNode["Score"].asString());
|
||||
if(!earPhoneNode["Threshold"].isNull())
|
||||
data_.personInfo.earPhone.threshold = std::stof(earPhoneNode["Threshold"].asString());
|
||||
auto cellPhoneNode = personInfoNode["CellPhone"];
|
||||
if(!cellPhoneNode["Score"].isNull())
|
||||
data_.personInfo.cellPhone.score = std::stof(cellPhoneNode["Score"].asString());
|
||||
if(!cellPhoneNode["Threshold"].isNull())
|
||||
data_.personInfo.cellPhone.threshold = std::stof(cellPhoneNode["Threshold"].asString());
|
||||
auto faceInfoNode = dataNode["FaceInfo"];
|
||||
if(!faceInfoNode["Completeness"].isNull())
|
||||
data_.faceInfo.completeness = std::stol(faceInfoNode["Completeness"].asString());
|
||||
@@ -69,6 +56,19 @@ void MonitorExaminationResult::parse(const std::string &payload)
|
||||
data_.faceInfo.pose.roll = std::stof(poseNode["Roll"].asString());
|
||||
if(!poseNode["Yaw"].isNull())
|
||||
data_.faceInfo.pose.yaw = std::stof(poseNode["Yaw"].asString());
|
||||
auto personInfoNode = dataNode["PersonInfo"];
|
||||
if(!personInfoNode["PersonNumber"].isNull())
|
||||
data_.personInfo.personNumber = std::stol(personInfoNode["PersonNumber"].asString());
|
||||
auto cellPhoneNode = personInfoNode["CellPhone"];
|
||||
if(!cellPhoneNode["Score"].isNull())
|
||||
data_.personInfo.cellPhone.score = std::stof(cellPhoneNode["Score"].asString());
|
||||
if(!cellPhoneNode["Threshold"].isNull())
|
||||
data_.personInfo.cellPhone.threshold = std::stof(cellPhoneNode["Threshold"].asString());
|
||||
auto earPhoneNode = personInfoNode["EarPhone"];
|
||||
if(!earPhoneNode["Score"].isNull())
|
||||
data_.personInfo.earPhone.score = std::stof(earPhoneNode["Score"].asString());
|
||||
if(!earPhoneNode["Threshold"].isNull())
|
||||
data_.personInfo.earPhone.threshold = std::stof(earPhoneNode["Threshold"].asString());
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
if(!value["Code"].isNull())
|
||||
|
||||
@@ -44,22 +44,22 @@ void QueryFaceImageTemplateResult::parse(const std::string &payload)
|
||||
for (auto dataNodeElementsElementsItem : allElementsNode)
|
||||
{
|
||||
Data::ElementsItem elementsItemObject;
|
||||
if(!dataNodeElementsElementsItem["TemplateURL"].isNull())
|
||||
elementsItemObject.templateURL = dataNodeElementsElementsItem["TemplateURL"].asString();
|
||||
if(!dataNodeElementsElementsItem["UserId"].isNull())
|
||||
elementsItemObject.userId = dataNodeElementsElementsItem["UserId"].asString();
|
||||
if(!dataNodeElementsElementsItem["CreateTime"].isNull())
|
||||
elementsItemObject.createTime = dataNodeElementsElementsItem["CreateTime"].asString();
|
||||
if(!dataNodeElementsElementsItem["UpdateTime"].isNull())
|
||||
elementsItemObject.updateTime = dataNodeElementsElementsItem["UpdateTime"].asString();
|
||||
if(!dataNodeElementsElementsItem["UserId"].isNull())
|
||||
elementsItemObject.userId = dataNodeElementsElementsItem["UserId"].asString();
|
||||
if(!dataNodeElementsElementsItem["TemplateId"].isNull())
|
||||
elementsItemObject.templateId = dataNodeElementsElementsItem["TemplateId"].asString();
|
||||
if(!dataNodeElementsElementsItem["TemplateURL"].isNull())
|
||||
elementsItemObject.templateURL = dataNodeElementsElementsItem["TemplateURL"].asString();
|
||||
data_.elements.push_back(elementsItemObject);
|
||||
}
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
if(!value["Code"].isNull())
|
||||
code_ = value["Code"].asString();
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -40,22 +40,22 @@ void RecognizeHandGestureResult::parse(const std::string &payload)
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
if(!dataNode["Score"].isNull())
|
||||
data_.score = std::stof(dataNode["Score"].asString());
|
||||
if(!dataNode["Type"].isNull())
|
||||
data_.type = dataNode["Type"].asString();
|
||||
if(!dataNode["X"].isNull())
|
||||
data_.x = std::stol(dataNode["X"].asString());
|
||||
if(!dataNode["Y"].isNull())
|
||||
data_.y = std::stol(dataNode["Y"].asString());
|
||||
if(!dataNode["Height"].isNull())
|
||||
data_.height = std::stol(dataNode["Height"].asString());
|
||||
if(!dataNode["Width"].isNull())
|
||||
data_.width = std::stol(dataNode["Width"].asString());
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
if(!dataNode["Height"].isNull())
|
||||
data_.height = std::stol(dataNode["Height"].asString());
|
||||
if(!dataNode["Score"].isNull())
|
||||
data_.score = std::stof(dataNode["Score"].asString());
|
||||
if(!value["Code"].isNull())
|
||||
code_ = value["Code"].asString();
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user