Release EvaluateCertificateQuality.

This commit is contained in:
sdk-team
2020-12-18 06:16:28 +00:00
parent 45daf26fac
commit 49feb2bedd
8 changed files with 276 additions and 0 deletions

View File

@@ -1,3 +1,6 @@
2020-12-18 Version: patch
- Release EvaluateCertificateQuality.
2020-12-18 Version: patch
- Generated 2020-05-18 for `dataworks-public`.

View File

@@ -27,6 +27,8 @@ set(imagerecog_public_header_model
include/alibabacloud/imagerecog/model/DetectFruitsResult.h
include/alibabacloud/imagerecog/model/DetectImageElementsRequest.h
include/alibabacloud/imagerecog/model/DetectImageElementsResult.h
include/alibabacloud/imagerecog/model/EvaluateCertificateQualityRequest.h
include/alibabacloud/imagerecog/model/EvaluateCertificateQualityResult.h
include/alibabacloud/imagerecog/model/RecognizeImageColorRequest.h
include/alibabacloud/imagerecog/model/RecognizeImageColorResult.h
include/alibabacloud/imagerecog/model/RecognizeImageStyleRequest.h
@@ -48,6 +50,8 @@ set(imagerecog_src
src/model/DetectFruitsResult.cc
src/model/DetectImageElementsRequest.cc
src/model/DetectImageElementsResult.cc
src/model/EvaluateCertificateQualityRequest.cc
src/model/EvaluateCertificateQualityResult.cc
src/model/RecognizeImageColorRequest.cc
src/model/RecognizeImageColorResult.cc
src/model/RecognizeImageStyleRequest.cc

View File

@@ -28,6 +28,8 @@
#include "model/DetectFruitsResult.h"
#include "model/DetectImageElementsRequest.h"
#include "model/DetectImageElementsResult.h"
#include "model/EvaluateCertificateQualityRequest.h"
#include "model/EvaluateCertificateQualityResult.h"
#include "model/RecognizeImageColorRequest.h"
#include "model/RecognizeImageColorResult.h"
#include "model/RecognizeImageStyleRequest.h"
@@ -58,6 +60,9 @@ namespace AlibabaCloud
typedef Outcome<Error, Model::DetectImageElementsResult> DetectImageElementsOutcome;
typedef std::future<DetectImageElementsOutcome> DetectImageElementsOutcomeCallable;
typedef std::function<void(const ImagerecogClient*, const Model::DetectImageElementsRequest&, const DetectImageElementsOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DetectImageElementsAsyncHandler;
typedef Outcome<Error, Model::EvaluateCertificateQualityResult> EvaluateCertificateQualityOutcome;
typedef std::future<EvaluateCertificateQualityOutcome> EvaluateCertificateQualityOutcomeCallable;
typedef std::function<void(const ImagerecogClient*, const Model::EvaluateCertificateQualityRequest&, const EvaluateCertificateQualityOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> EvaluateCertificateQualityAsyncHandler;
typedef Outcome<Error, Model::RecognizeImageColorResult> RecognizeImageColorOutcome;
typedef std::future<RecognizeImageColorOutcome> RecognizeImageColorOutcomeCallable;
typedef std::function<void(const ImagerecogClient*, const Model::RecognizeImageColorRequest&, const RecognizeImageColorOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RecognizeImageColorAsyncHandler;
@@ -90,6 +95,9 @@ namespace AlibabaCloud
DetectImageElementsOutcome detectImageElements(const Model::DetectImageElementsRequest &request)const;
void detectImageElementsAsync(const Model::DetectImageElementsRequest& request, const DetectImageElementsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
DetectImageElementsOutcomeCallable detectImageElementsCallable(const Model::DetectImageElementsRequest& request) const;
EvaluateCertificateQualityOutcome evaluateCertificateQuality(const Model::EvaluateCertificateQualityRequest &request)const;
void evaluateCertificateQualityAsync(const Model::EvaluateCertificateQualityRequest& request, const EvaluateCertificateQualityAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
EvaluateCertificateQualityOutcomeCallable evaluateCertificateQualityCallable(const Model::EvaluateCertificateQualityRequest& request) const;
RecognizeImageColorOutcome recognizeImageColor(const Model::RecognizeImageColorRequest &request)const;
void recognizeImageColorAsync(const Model::RecognizeImageColorRequest& request, const RecognizeImageColorAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
RecognizeImageColorOutcomeCallable recognizeImageColorCallable(const Model::RecognizeImageColorRequest& request) const;

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.
*/
#ifndef ALIBABACLOUD_IMAGERECOG_MODEL_EVALUATECERTIFICATEQUALITYREQUEST_H_
#define ALIBABACLOUD_IMAGERECOG_MODEL_EVALUATECERTIFICATEQUALITYREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/imagerecog/ImagerecogExport.h>
namespace AlibabaCloud
{
namespace Imagerecog
{
namespace Model
{
class ALIBABACLOUD_IMAGERECOG_EXPORT EvaluateCertificateQualityRequest : public RpcServiceRequest
{
public:
EvaluateCertificateQualityRequest();
~EvaluateCertificateQualityRequest();
std::string getType()const;
void setType(const std::string& type);
std::string getImageURL()const;
void setImageURL(const std::string& imageURL);
private:
std::string type_;
std::string imageURL_;
};
}
}
}
#endif // !ALIBABACLOUD_IMAGERECOG_MODEL_EVALUATECERTIFICATEQUALITYREQUEST_H_

View File

@@ -0,0 +1,61 @@
/*
* 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.
*/
#ifndef ALIBABACLOUD_IMAGERECOG_MODEL_EVALUATECERTIFICATEQUALITYRESULT_H_
#define ALIBABACLOUD_IMAGERECOG_MODEL_EVALUATECERTIFICATEQUALITYRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/imagerecog/ImagerecogExport.h>
namespace AlibabaCloud
{
namespace Imagerecog
{
namespace Model
{
class ALIBABACLOUD_IMAGERECOG_EXPORT EvaluateCertificateQualityResult : public ServiceResult
{
public:
struct Data
{
struct Element
{
std::string score;
std::string pass;
std::string value;
};
std::vector<Element> elements;
};
EvaluateCertificateQualityResult();
explicit EvaluateCertificateQualityResult(const std::string &payload);
~EvaluateCertificateQualityResult();
Data getData()const;
protected:
void parse(const std::string &payload);
private:
Data data_;
};
}
}
}
#endif // !ALIBABACLOUD_IMAGERECOG_MODEL_EVALUATECERTIFICATEQUALITYRESULT_H_

View File

@@ -159,6 +159,42 @@ ImagerecogClient::DetectImageElementsOutcomeCallable ImagerecogClient::detectIma
return task->get_future();
}
ImagerecogClient::EvaluateCertificateQualityOutcome ImagerecogClient::evaluateCertificateQuality(const EvaluateCertificateQualityRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return EvaluateCertificateQualityOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return EvaluateCertificateQualityOutcome(EvaluateCertificateQualityResult(outcome.result()));
else
return EvaluateCertificateQualityOutcome(outcome.error());
}
void ImagerecogClient::evaluateCertificateQualityAsync(const EvaluateCertificateQualityRequest& request, const EvaluateCertificateQualityAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, evaluateCertificateQuality(request), context);
};
asyncExecute(new Runnable(fn));
}
ImagerecogClient::EvaluateCertificateQualityOutcomeCallable ImagerecogClient::evaluateCertificateQualityCallable(const EvaluateCertificateQualityRequest &request) const
{
auto task = std::make_shared<std::packaged_task<EvaluateCertificateQualityOutcome()>>(
[this, request]()
{
return this->evaluateCertificateQuality(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
ImagerecogClient::RecognizeImageColorOutcome ImagerecogClient::recognizeImageColor(const RecognizeImageColorRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();

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/imagerecog/model/EvaluateCertificateQualityRequest.h>
using AlibabaCloud::Imagerecog::Model::EvaluateCertificateQualityRequest;
EvaluateCertificateQualityRequest::EvaluateCertificateQualityRequest() :
RpcServiceRequest("imagerecog", "2019-09-30", "EvaluateCertificateQuality")
{
setMethod(HttpRequest::Method::Post);
}
EvaluateCertificateQualityRequest::~EvaluateCertificateQualityRequest()
{}
std::string EvaluateCertificateQualityRequest::getType()const
{
return type_;
}
void EvaluateCertificateQualityRequest::setType(const std::string& type)
{
type_ = type;
setBodyParameter("Type", type);
}
std::string EvaluateCertificateQualityRequest::getImageURL()const
{
return imageURL_;
}
void EvaluateCertificateQualityRequest::setImageURL(const std::string& imageURL)
{
imageURL_ = imageURL;
setBodyParameter("ImageURL", imageURL);
}

View 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/imagerecog/model/EvaluateCertificateQualityResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Imagerecog;
using namespace AlibabaCloud::Imagerecog::Model;
EvaluateCertificateQualityResult::EvaluateCertificateQualityResult() :
ServiceResult()
{}
EvaluateCertificateQualityResult::EvaluateCertificateQualityResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
EvaluateCertificateQualityResult::~EvaluateCertificateQualityResult()
{}
void EvaluateCertificateQualityResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto dataNode = value["Data"];
auto allElementsNode = dataNode["Elements"]["Element"];
for (auto dataNodeElementsElement : allElementsNode)
{
Data::Element elementObject;
if(!dataNodeElementsElement["Value"].isNull())
elementObject.value = dataNodeElementsElement["Value"].asString();
if(!dataNodeElementsElement["Pass"].isNull())
elementObject.pass = dataNodeElementsElement["Pass"].asString();
if(!dataNodeElementsElement["Score"].isNull())
elementObject.score = dataNodeElementsElement["Score"].asString();
data_.elements.push_back(elementObject);
}
}
EvaluateCertificateQualityResult::Data EvaluateCertificateQualityResult::getData()const
{
return data_;
}