Add face quality detection API.
This commit is contained in:
@@ -195,6 +195,42 @@ VcsClient::DeleteDeviceOutcomeCallable VcsClient::deleteDeviceCallable(const Del
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
VcsClient::DeleteRecordsOutcome VcsClient::deleteRecords(const DeleteRecordsRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return DeleteRecordsOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return DeleteRecordsOutcome(DeleteRecordsResult(outcome.result()));
|
||||
else
|
||||
return DeleteRecordsOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void VcsClient::deleteRecordsAsync(const DeleteRecordsRequest& request, const DeleteRecordsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, deleteRecords(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
VcsClient::DeleteRecordsOutcomeCallable VcsClient::deleteRecordsCallable(const DeleteRecordsRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<DeleteRecordsOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->deleteRecords(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
VcsClient::GetBodyOptionsOutcome VcsClient::getBodyOptions(const GetBodyOptionsRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
@@ -555,6 +591,42 @@ VcsClient::ListPersonsOutcomeCallable VcsClient::listPersonsCallable(const ListP
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
VcsClient::RecognizeFaceQualityOutcome VcsClient::recognizeFaceQuality(const RecognizeFaceQualityRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return RecognizeFaceQualityOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return RecognizeFaceQualityOutcome(RecognizeFaceQualityResult(outcome.result()));
|
||||
else
|
||||
return RecognizeFaceQualityOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void VcsClient::recognizeFaceQualityAsync(const RecognizeFaceQualityRequest& request, const RecognizeFaceQualityAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, recognizeFaceQuality(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
VcsClient::RecognizeFaceQualityOutcomeCallable VcsClient::recognizeFaceQualityCallable(const RecognizeFaceQualityRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<RecognizeFaceQualityOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->recognizeFaceQuality(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
VcsClient::RecognizeImageOutcome VcsClient::recognizeImage(const RecognizeImageRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
|
||||
84
vcs/src/model/DeleteRecordsRequest.cc
Normal file
84
vcs/src/model/DeleteRecordsRequest.cc
Normal file
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
* 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/DeleteRecordsRequest.h>
|
||||
|
||||
using AlibabaCloud::Vcs::Model::DeleteRecordsRequest;
|
||||
|
||||
DeleteRecordsRequest::DeleteRecordsRequest() :
|
||||
RpcServiceRequest("vcs", "2020-05-15", "DeleteRecords")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
DeleteRecordsRequest::~DeleteRecordsRequest()
|
||||
{}
|
||||
|
||||
std::string DeleteRecordsRequest::getAlgorithmType()const
|
||||
{
|
||||
return algorithmType_;
|
||||
}
|
||||
|
||||
void DeleteRecordsRequest::setAlgorithmType(const std::string& algorithmType)
|
||||
{
|
||||
algorithmType_ = algorithmType;
|
||||
setBodyParameter("AlgorithmType", algorithmType);
|
||||
}
|
||||
|
||||
std::string DeleteRecordsRequest::getCorpId()const
|
||||
{
|
||||
return corpId_;
|
||||
}
|
||||
|
||||
void DeleteRecordsRequest::setCorpId(const std::string& corpId)
|
||||
{
|
||||
corpId_ = corpId;
|
||||
setBodyParameter("CorpId", corpId);
|
||||
}
|
||||
|
||||
std::string DeleteRecordsRequest::getAttributeName()const
|
||||
{
|
||||
return attributeName_;
|
||||
}
|
||||
|
||||
void DeleteRecordsRequest::setAttributeName(const std::string& attributeName)
|
||||
{
|
||||
attributeName_ = attributeName;
|
||||
setBodyParameter("AttributeName", attributeName);
|
||||
}
|
||||
|
||||
std::string DeleteRecordsRequest::getOperatorType()const
|
||||
{
|
||||
return operatorType_;
|
||||
}
|
||||
|
||||
void DeleteRecordsRequest::setOperatorType(const std::string& operatorType)
|
||||
{
|
||||
operatorType_ = operatorType;
|
||||
setBodyParameter("OperatorType", operatorType);
|
||||
}
|
||||
|
||||
std::string DeleteRecordsRequest::getValue()const
|
||||
{
|
||||
return value_;
|
||||
}
|
||||
|
||||
void DeleteRecordsRequest::setValue(const std::string& value)
|
||||
{
|
||||
value_ = value;
|
||||
setBodyParameter("Value", value);
|
||||
}
|
||||
|
||||
65
vcs/src/model/DeleteRecordsResult.cc
Normal file
65
vcs/src/model/DeleteRecordsResult.cc
Normal file
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* 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/DeleteRecordsResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Vcs;
|
||||
using namespace AlibabaCloud::Vcs::Model;
|
||||
|
||||
DeleteRecordsResult::DeleteRecordsResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
DeleteRecordsResult::DeleteRecordsResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
DeleteRecordsResult::~DeleteRecordsResult()
|
||||
{}
|
||||
|
||||
void DeleteRecordsResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["Code"].isNull())
|
||||
code_ = value["Code"].asString();
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
if(!value["Data"].isNull())
|
||||
data_ = value["Data"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string DeleteRecordsResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
std::string DeleteRecordsResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
std::string DeleteRecordsResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
62
vcs/src/model/RecognizeFaceQualityRequest.cc
Normal file
62
vcs/src/model/RecognizeFaceQualityRequest.cc
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* 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/RecognizeFaceQualityRequest.h>
|
||||
|
||||
using AlibabaCloud::Vcs::Model::RecognizeFaceQualityRequest;
|
||||
|
||||
RecognizeFaceQualityRequest::RecognizeFaceQualityRequest() :
|
||||
RpcServiceRequest("vcs", "2020-05-15", "RecognizeFaceQuality")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
RecognizeFaceQualityRequest::~RecognizeFaceQualityRequest()
|
||||
{}
|
||||
|
||||
std::string RecognizeFaceQualityRequest::getCorpId()const
|
||||
{
|
||||
return corpId_;
|
||||
}
|
||||
|
||||
void RecognizeFaceQualityRequest::setCorpId(const std::string& corpId)
|
||||
{
|
||||
corpId_ = corpId;
|
||||
setBodyParameter("CorpId", corpId);
|
||||
}
|
||||
|
||||
std::string RecognizeFaceQualityRequest::getPicContent()const
|
||||
{
|
||||
return picContent_;
|
||||
}
|
||||
|
||||
void RecognizeFaceQualityRequest::setPicContent(const std::string& picContent)
|
||||
{
|
||||
picContent_ = picContent;
|
||||
setBodyParameter("PicContent", picContent);
|
||||
}
|
||||
|
||||
std::string RecognizeFaceQualityRequest::getPicFormat()const
|
||||
{
|
||||
return picFormat_;
|
||||
}
|
||||
|
||||
void RecognizeFaceQualityRequest::setPicFormat(const std::string& picFormat)
|
||||
{
|
||||
picFormat_ = picFormat;
|
||||
setBodyParameter("PicFormat", picFormat);
|
||||
}
|
||||
|
||||
68
vcs/src/model/RecognizeFaceQualityResult.cc
Normal file
68
vcs/src/model/RecognizeFaceQualityResult.cc
Normal file
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
* 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/RecognizeFaceQualityResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Vcs;
|
||||
using namespace AlibabaCloud::Vcs::Model;
|
||||
|
||||
RecognizeFaceQualityResult::RecognizeFaceQualityResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
RecognizeFaceQualityResult::RecognizeFaceQualityResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
RecognizeFaceQualityResult::~RecognizeFaceQualityResult()
|
||||
{}
|
||||
|
||||
void RecognizeFaceQualityResult::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["QualityScore"].isNull())
|
||||
data_.qualityScore = dataNode["QualityScore"].asString();
|
||||
if(!dataNode["Description"].isNull())
|
||||
data_.description = dataNode["Description"].asString();
|
||||
if(!value["Code"].isNull())
|
||||
code_ = value["Code"].asString();
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string RecognizeFaceQualityResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
RecognizeFaceQualityResult::Data RecognizeFaceQualityResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
std::string RecognizeFaceQualityResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user