Update api ExecuteServerSideVerification The base64 data format is changed from string byte to string.

This commit is contained in:
sdk-team
2022-12-23 01:48:11 +00:00
parent 0e89026533
commit fec6edb88e
12 changed files with 589 additions and 1 deletions

View File

@@ -735,6 +735,42 @@ FacebodyClient::DetectIPCPedestrianOutcomeCallable FacebodyClient::detectIPCPede
return task->get_future();
}
FacebodyClient::DetectIPCPedestrianOptimizedOutcome FacebodyClient::detectIPCPedestrianOptimized(const DetectIPCPedestrianOptimizedRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return DetectIPCPedestrianOptimizedOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return DetectIPCPedestrianOptimizedOutcome(DetectIPCPedestrianOptimizedResult(outcome.result()));
else
return DetectIPCPedestrianOptimizedOutcome(outcome.error());
}
void FacebodyClient::detectIPCPedestrianOptimizedAsync(const DetectIPCPedestrianOptimizedRequest& request, const DetectIPCPedestrianOptimizedAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, detectIPCPedestrianOptimized(request), context);
};
asyncExecute(new Runnable(fn));
}
FacebodyClient::DetectIPCPedestrianOptimizedOutcomeCallable FacebodyClient::detectIPCPedestrianOptimizedCallable(const DetectIPCPedestrianOptimizedRequest &request) const
{
auto task = std::make_shared<std::packaged_task<DetectIPCPedestrianOptimizedOutcome()>>(
[this, request]()
{
return this->detectIPCPedestrianOptimized(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
FacebodyClient::DetectLivingFaceOutcome FacebodyClient::detectLivingFace(const DetectLivingFaceRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -915,6 +951,42 @@ FacebodyClient::EnhanceFaceOutcomeCallable FacebodyClient::enhanceFaceCallable(c
return task->get_future();
}
FacebodyClient::ExecuteServerSideVerificationOutcome FacebodyClient::executeServerSideVerification(const ExecuteServerSideVerificationRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return ExecuteServerSideVerificationOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return ExecuteServerSideVerificationOutcome(ExecuteServerSideVerificationResult(outcome.result()));
else
return ExecuteServerSideVerificationOutcome(outcome.error());
}
void FacebodyClient::executeServerSideVerificationAsync(const ExecuteServerSideVerificationRequest& request, const ExecuteServerSideVerificationAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, executeServerSideVerification(request), context);
};
asyncExecute(new Runnable(fn));
}
FacebodyClient::ExecuteServerSideVerificationOutcomeCallable FacebodyClient::executeServerSideVerificationCallable(const ExecuteServerSideVerificationRequest &request) const
{
auto task = std::make_shared<std::packaged_task<ExecuteServerSideVerificationOutcome()>>(
[this, request]()
{
return this->executeServerSideVerification(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
FacebodyClient::ExtractFingerPrintOutcome FacebodyClient::extractFingerPrint(const ExtractFingerPrintRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();

View File

@@ -0,0 +1,55 @@
/*
* 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/DetectIPCPedestrianOptimizedRequest.h>
using AlibabaCloud::Facebody::Model::DetectIPCPedestrianOptimizedRequest;
DetectIPCPedestrianOptimizedRequest::DetectIPCPedestrianOptimizedRequest()
: RoaServiceRequest("facebody", "2020-09-10") {
setResourcePath("/viapi/k8s/facebody/detect-ipc-pedestrian-optimized"};
setMethod(HttpRequest::Method::Post);
}
DetectIPCPedestrianOptimizedRequest::~DetectIPCPedestrianOptimizedRequest() {}
long DetectIPCPedestrianOptimizedRequest::getHeight() const {
return height_;
}
void DetectIPCPedestrianOptimizedRequest::setHeight(long height) {
height_ = height;
setBodyParameter(std::string("height"), std::to_string(height));
}
std::string DetectIPCPedestrianOptimizedRequest::getImageData() const {
return imageData_;
}
void DetectIPCPedestrianOptimizedRequest::setImageData(const std::string &imageData) {
imageData_ = imageData;
setBodyParameter(std::string("imageData"), imageData);
}
long DetectIPCPedestrianOptimizedRequest::getWidth() const {
return width_;
}
void DetectIPCPedestrianOptimizedRequest::setWidth(long width) {
width_ = width;
setBodyParameter(std::string("width"), std::to_string(width));
}

View File

@@ -0,0 +1,67 @@
/*
* 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/DetectIPCPedestrianOptimizedResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Facebody;
using namespace AlibabaCloud::Facebody::Model;
DetectIPCPedestrianOptimizedResult::DetectIPCPedestrianOptimizedResult() :
ServiceResult()
{}
DetectIPCPedestrianOptimizedResult::DetectIPCPedestrianOptimizedResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
DetectIPCPedestrianOptimizedResult::~DetectIPCPedestrianOptimizedResult()
{}
void DetectIPCPedestrianOptimizedResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto dataNode = value["Data"];
auto allImageInfoListNode = dataNode["ImageInfoList"]["imageInfoListItem"];
for (auto dataNodeImageInfoListimageInfoListItem : allImageInfoListNode)
{
Data::ImageInfoListItem imageInfoListItemObject;
auto allElementsNode = dataNodeImageInfoListimageInfoListItem["Elements"]["Element"];
for (auto dataNodeImageInfoListimageInfoListItemElementsElement : allElementsNode)
{
Data::ImageInfoListItem::Element elementsObject;
if(!dataNodeImageInfoListimageInfoListItemElementsElement["Score"].isNull())
elementsObject.score = std::stof(dataNodeImageInfoListimageInfoListItemElementsElement["Score"].asString());
auto allBoxes = value["Boxes"]["Box"];
for (auto value : allBoxes)
elementsObject.boxes.push_back(value.asString());
imageInfoListItemObject.elements.push_back(elementsObject);
}
data_.imageInfoList.push_back(imageInfoListItemObject);
}
}
DetectIPCPedestrianOptimizedResult::Data DetectIPCPedestrianOptimizedResult::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/facebody/model/ExecuteServerSideVerificationRequest.h>
using AlibabaCloud::Facebody::Model::ExecuteServerSideVerificationRequest;
ExecuteServerSideVerificationRequest::ExecuteServerSideVerificationRequest()
: RoaServiceRequest("facebody", "2020-09-10") {
setResourcePath("/viapi/thirdparty/realperson/execServerSideVerification"};
setMethod(HttpRequest::Method::Post);
}
ExecuteServerSideVerificationRequest::~ExecuteServerSideVerificationRequest() {}
std::string ExecuteServerSideVerificationRequest::getFacialPictureData() const {
return facialPictureData_;
}
void ExecuteServerSideVerificationRequest::setFacialPictureData(const std::string &facialPictureData) {
facialPictureData_ = facialPictureData;
setBodyParameter(std::string("facialPictureData"), facialPictureData);
}
std::string ExecuteServerSideVerificationRequest::getSceneType() const {
return sceneType_;
}
void ExecuteServerSideVerificationRequest::setSceneType(const std::string &sceneType) {
sceneType_ = sceneType;
setBodyParameter(std::string("sceneType"), sceneType);
}
std::string ExecuteServerSideVerificationRequest::getCertificateNumber() const {
return certificateNumber_;
}
void ExecuteServerSideVerificationRequest::setCertificateNumber(const std::string &certificateNumber) {
certificateNumber_ = certificateNumber;
setBodyParameter(std::string("certificateNumber"), certificateNumber);
}
std::string ExecuteServerSideVerificationRequest::getCertificateName() const {
return certificateName_;
}
void ExecuteServerSideVerificationRequest::setCertificateName(const std::string &certificateName) {
certificateName_ = certificateName;
setBodyParameter(std::string("certificateName"), certificateName);
}
std::string ExecuteServerSideVerificationRequest::getFacialPictureUrl() const {
return facialPictureUrl_;
}
void ExecuteServerSideVerificationRequest::setFacialPictureUrl(const std::string &facialPictureUrl) {
facialPictureUrl_ = facialPictureUrl;
setBodyParameter(std::string("facialPictureUrl"), facialPictureUrl);
}

View File

@@ -0,0 +1,70 @@
/*
* 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/ExecuteServerSideVerificationResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Facebody;
using namespace AlibabaCloud::Facebody::Model;
ExecuteServerSideVerificationResult::ExecuteServerSideVerificationResult() :
ServiceResult()
{}
ExecuteServerSideVerificationResult::ExecuteServerSideVerificationResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
ExecuteServerSideVerificationResult::~ExecuteServerSideVerificationResult()
{}
void ExecuteServerSideVerificationResult::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["Pass"].isNull())
data_.pass = dataNode["Pass"].asString() == "true";
if(!dataNode["VerificationToken"].isNull())
data_.verificationToken = dataNode["VerificationToken"].asString();
if(!dataNode["Reason"].isNull())
data_.reason = dataNode["Reason"].asString();
if(!value["Code"].isNull())
code_ = value["Code"].asString();
if(!value["Message"].isNull())
message_ = value["Message"].asString();
}
std::string ExecuteServerSideVerificationResult::getMessage()const
{
return message_;
}
ExecuteServerSideVerificationResult::Data ExecuteServerSideVerificationResult::getData()const
{
return data_;
}
std::string ExecuteServerSideVerificationResult::getCode()const
{
return code_;
}