From 53b22dba98f2e3f0e0d4a7ab490e85e90c4e1384 Mon Sep 17 00:00:00 2001 From: sdk-team Date: Fri, 24 Sep 2021 07:26:00 +0000 Subject: [PATCH] Release RetouchSkin LiquifyFace. --- CHANGELOG | 3 + VERSION | 2 +- facebody/CMakeLists.txt | 8 +++ .../alibabacloud/facebody/FacebodyClient.h | 16 +++++ .../facebody/model/LiquifyFaceRequest.h | 51 +++++++++++++ .../facebody/model/LiquifyFaceResult.h | 59 +++++++++++++++ .../facebody/model/RetouchSkinRequest.h | 54 ++++++++++++++ .../facebody/model/RetouchSkinResult.h | 59 +++++++++++++++ facebody/src/FacebodyClient.cc | 72 +++++++++++++++++++ facebody/src/model/LiquifyFaceRequest.cc | 51 +++++++++++++ facebody/src/model/LiquifyFaceResult.cc | 66 +++++++++++++++++ facebody/src/model/RetouchSkinRequest.cc | 62 ++++++++++++++++ facebody/src/model/RetouchSkinResult.cc | 66 +++++++++++++++++ 13 files changed, 568 insertions(+), 1 deletion(-) create mode 100644 facebody/include/alibabacloud/facebody/model/LiquifyFaceRequest.h create mode 100644 facebody/include/alibabacloud/facebody/model/LiquifyFaceResult.h create mode 100644 facebody/include/alibabacloud/facebody/model/RetouchSkinRequest.h create mode 100644 facebody/include/alibabacloud/facebody/model/RetouchSkinResult.h create mode 100644 facebody/src/model/LiquifyFaceRequest.cc create mode 100644 facebody/src/model/LiquifyFaceResult.cc create mode 100644 facebody/src/model/RetouchSkinRequest.cc create mode 100644 facebody/src/model/RetouchSkinResult.cc diff --git a/CHANGELOG b/CHANGELOG index aeadc541d..c68c51ec9 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2021-09-24 Version: 1.36.884 +- Release RetouchSkin LiquifyFace. + 2021-09-23 Version: 1.36.883 - Supports the purchase of polardb storage packages. - Support temporary upgrades and allocations of instances. diff --git a/VERSION b/VERSION index cdb143201..ad38c3f3f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.883 \ No newline at end of file +1.36.884 \ No newline at end of file diff --git a/facebody/CMakeLists.txt b/facebody/CMakeLists.txt index d6dcbcf4a..4aab900b8 100644 --- a/facebody/CMakeLists.txt +++ b/facebody/CMakeLists.txt @@ -107,6 +107,8 @@ set(facebody_public_header_model include/alibabacloud/facebody/model/GetRealPersonVerificationResultResult.h include/alibabacloud/facebody/model/HandPostureRequest.h include/alibabacloud/facebody/model/HandPostureResult.h + include/alibabacloud/facebody/model/LiquifyFaceRequest.h + include/alibabacloud/facebody/model/LiquifyFaceResult.h include/alibabacloud/facebody/model/ListBodyDbsRequest.h include/alibabacloud/facebody/model/ListBodyDbsResult.h include/alibabacloud/facebody/model/ListBodyPersonRequest.h @@ -135,6 +137,8 @@ set(facebody_public_header_model include/alibabacloud/facebody/model/RecognizePublicFaceResult.h include/alibabacloud/facebody/model/RetouchBodyRequest.h include/alibabacloud/facebody/model/RetouchBodyResult.h + include/alibabacloud/facebody/model/RetouchSkinRequest.h + include/alibabacloud/facebody/model/RetouchSkinResult.h include/alibabacloud/facebody/model/SearchBodyTraceRequest.h include/alibabacloud/facebody/model/SearchBodyTraceResult.h include/alibabacloud/facebody/model/SearchFaceRequest.h @@ -234,6 +238,8 @@ set(facebody_src src/model/GetRealPersonVerificationResultResult.cc src/model/HandPostureRequest.cc src/model/HandPostureResult.cc + src/model/LiquifyFaceRequest.cc + src/model/LiquifyFaceResult.cc src/model/ListBodyDbsRequest.cc src/model/ListBodyDbsResult.cc src/model/ListBodyPersonRequest.cc @@ -262,6 +268,8 @@ set(facebody_src src/model/RecognizePublicFaceResult.cc src/model/RetouchBodyRequest.cc src/model/RetouchBodyResult.cc + src/model/RetouchSkinRequest.cc + src/model/RetouchSkinResult.cc src/model/SearchBodyTraceRequest.cc src/model/SearchBodyTraceResult.cc src/model/SearchFaceRequest.cc diff --git a/facebody/include/alibabacloud/facebody/FacebodyClient.h b/facebody/include/alibabacloud/facebody/FacebodyClient.h index 084ff6d9c..0a1005439 100644 --- a/facebody/include/alibabacloud/facebody/FacebodyClient.h +++ b/facebody/include/alibabacloud/facebody/FacebodyClient.h @@ -108,6 +108,8 @@ #include "model/GetRealPersonVerificationResultResult.h" #include "model/HandPostureRequest.h" #include "model/HandPostureResult.h" +#include "model/LiquifyFaceRequest.h" +#include "model/LiquifyFaceResult.h" #include "model/ListBodyDbsRequest.h" #include "model/ListBodyDbsResult.h" #include "model/ListBodyPersonRequest.h" @@ -136,6 +138,8 @@ #include "model/RecognizePublicFaceResult.h" #include "model/RetouchBodyRequest.h" #include "model/RetouchBodyResult.h" +#include "model/RetouchSkinRequest.h" +#include "model/RetouchSkinResult.h" #include "model/SearchBodyTraceRequest.h" #include "model/SearchBodyTraceResult.h" #include "model/SearchFaceRequest.h" @@ -284,6 +288,9 @@ namespace AlibabaCloud typedef Outcome HandPostureOutcome; typedef std::future HandPostureOutcomeCallable; typedef std::function&)> HandPostureAsyncHandler; + typedef Outcome LiquifyFaceOutcome; + typedef std::future LiquifyFaceOutcomeCallable; + typedef std::function&)> LiquifyFaceAsyncHandler; typedef Outcome ListBodyDbsOutcome; typedef std::future ListBodyDbsOutcomeCallable; typedef std::function&)> ListBodyDbsAsyncHandler; @@ -326,6 +333,9 @@ namespace AlibabaCloud typedef Outcome RetouchBodyOutcome; typedef std::future RetouchBodyOutcomeCallable; typedef std::function&)> RetouchBodyAsyncHandler; + typedef Outcome RetouchSkinOutcome; + typedef std::future RetouchSkinOutcomeCallable; + typedef std::function&)> RetouchSkinAsyncHandler; typedef Outcome SearchBodyTraceOutcome; typedef std::future SearchBodyTraceOutcomeCallable; typedef std::function&)> SearchBodyTraceAsyncHandler; @@ -475,6 +485,9 @@ namespace AlibabaCloud HandPostureOutcome handPosture(const Model::HandPostureRequest &request)const; void handPostureAsync(const Model::HandPostureRequest& request, const HandPostureAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; HandPostureOutcomeCallable handPostureCallable(const Model::HandPostureRequest& request) const; + LiquifyFaceOutcome liquifyFace(const Model::LiquifyFaceRequest &request)const; + void liquifyFaceAsync(const Model::LiquifyFaceRequest& request, const LiquifyFaceAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + LiquifyFaceOutcomeCallable liquifyFaceCallable(const Model::LiquifyFaceRequest& request) const; ListBodyDbsOutcome listBodyDbs(const Model::ListBodyDbsRequest &request)const; void listBodyDbsAsync(const Model::ListBodyDbsRequest& request, const ListBodyDbsAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; ListBodyDbsOutcomeCallable listBodyDbsCallable(const Model::ListBodyDbsRequest& request) const; @@ -517,6 +530,9 @@ namespace AlibabaCloud RetouchBodyOutcome retouchBody(const Model::RetouchBodyRequest &request)const; void retouchBodyAsync(const Model::RetouchBodyRequest& request, const RetouchBodyAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; RetouchBodyOutcomeCallable retouchBodyCallable(const Model::RetouchBodyRequest& request) const; + RetouchSkinOutcome retouchSkin(const Model::RetouchSkinRequest &request)const; + void retouchSkinAsync(const Model::RetouchSkinRequest& request, const RetouchSkinAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + RetouchSkinOutcomeCallable retouchSkinCallable(const Model::RetouchSkinRequest& request) const; SearchBodyTraceOutcome searchBodyTrace(const Model::SearchBodyTraceRequest &request)const; void searchBodyTraceAsync(const Model::SearchBodyTraceRequest& request, const SearchBodyTraceAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; SearchBodyTraceOutcomeCallable searchBodyTraceCallable(const Model::SearchBodyTraceRequest& request) const; diff --git a/facebody/include/alibabacloud/facebody/model/LiquifyFaceRequest.h b/facebody/include/alibabacloud/facebody/model/LiquifyFaceRequest.h new file mode 100644 index 000000000..5291d8d9a --- /dev/null +++ b/facebody/include/alibabacloud/facebody/model/LiquifyFaceRequest.h @@ -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_FACEBODY_MODEL_LIQUIFYFACEREQUEST_H_ +#define ALIBABACLOUD_FACEBODY_MODEL_LIQUIFYFACEREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Facebody + { + namespace Model + { + class ALIBABACLOUD_FACEBODY_EXPORT LiquifyFaceRequest : public RpcServiceRequest + { + + public: + LiquifyFaceRequest(); + ~LiquifyFaceRequest(); + + float getSlimDegree()const; + void setSlimDegree(float slimDegree); + std::string getImageURL()const; + void setImageURL(const std::string& imageURL); + + private: + float slimDegree_; + std::string imageURL_; + + }; + } + } +} +#endif // !ALIBABACLOUD_FACEBODY_MODEL_LIQUIFYFACEREQUEST_H_ \ No newline at end of file diff --git a/facebody/include/alibabacloud/facebody/model/LiquifyFaceResult.h b/facebody/include/alibabacloud/facebody/model/LiquifyFaceResult.h new file mode 100644 index 000000000..9a28af486 --- /dev/null +++ b/facebody/include/alibabacloud/facebody/model/LiquifyFaceResult.h @@ -0,0 +1,59 @@ +/* + * 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_FACEBODY_MODEL_LIQUIFYFACERESULT_H_ +#define ALIBABACLOUD_FACEBODY_MODEL_LIQUIFYFACERESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Facebody + { + namespace Model + { + class ALIBABACLOUD_FACEBODY_EXPORT LiquifyFaceResult : public ServiceResult + { + public: + struct Data + { + std::string imageURL; + }; + + + LiquifyFaceResult(); + explicit LiquifyFaceResult(const std::string &payload); + ~LiquifyFaceResult(); + std::string getMessage()const; + Data getData()const; + std::string getCode()const; + + protected: + void parse(const std::string &payload); + private: + std::string message_; + Data data_; + std::string code_; + + }; + } + } +} +#endif // !ALIBABACLOUD_FACEBODY_MODEL_LIQUIFYFACERESULT_H_ \ No newline at end of file diff --git a/facebody/include/alibabacloud/facebody/model/RetouchSkinRequest.h b/facebody/include/alibabacloud/facebody/model/RetouchSkinRequest.h new file mode 100644 index 000000000..164547b86 --- /dev/null +++ b/facebody/include/alibabacloud/facebody/model/RetouchSkinRequest.h @@ -0,0 +1,54 @@ +/* + * 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_FACEBODY_MODEL_RETOUCHSKINREQUEST_H_ +#define ALIBABACLOUD_FACEBODY_MODEL_RETOUCHSKINREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Facebody + { + namespace Model + { + class ALIBABACLOUD_FACEBODY_EXPORT RetouchSkinRequest : public RpcServiceRequest + { + + public: + RetouchSkinRequest(); + ~RetouchSkinRequest(); + + float getRetouchDegree()const; + void setRetouchDegree(float retouchDegree); + float getWhiteningDegree()const; + void setWhiteningDegree(float whiteningDegree); + std::string getImageURL()const; + void setImageURL(const std::string& imageURL); + + private: + float retouchDegree_; + float whiteningDegree_; + std::string imageURL_; + + }; + } + } +} +#endif // !ALIBABACLOUD_FACEBODY_MODEL_RETOUCHSKINREQUEST_H_ \ No newline at end of file diff --git a/facebody/include/alibabacloud/facebody/model/RetouchSkinResult.h b/facebody/include/alibabacloud/facebody/model/RetouchSkinResult.h new file mode 100644 index 000000000..57a6973fd --- /dev/null +++ b/facebody/include/alibabacloud/facebody/model/RetouchSkinResult.h @@ -0,0 +1,59 @@ +/* + * 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_FACEBODY_MODEL_RETOUCHSKINRESULT_H_ +#define ALIBABACLOUD_FACEBODY_MODEL_RETOUCHSKINRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Facebody + { + namespace Model + { + class ALIBABACLOUD_FACEBODY_EXPORT RetouchSkinResult : public ServiceResult + { + public: + struct Data + { + std::string imageURL; + }; + + + RetouchSkinResult(); + explicit RetouchSkinResult(const std::string &payload); + ~RetouchSkinResult(); + std::string getMessage()const; + Data getData()const; + std::string getCode()const; + + protected: + void parse(const std::string &payload); + private: + std::string message_; + Data data_; + std::string code_; + + }; + } + } +} +#endif // !ALIBABACLOUD_FACEBODY_MODEL_RETOUCHSKINRESULT_H_ \ No newline at end of file diff --git a/facebody/src/FacebodyClient.cc b/facebody/src/FacebodyClient.cc index a94353f36..f1684333e 100644 --- a/facebody/src/FacebodyClient.cc +++ b/facebody/src/FacebodyClient.cc @@ -1599,6 +1599,42 @@ FacebodyClient::HandPostureOutcomeCallable FacebodyClient::handPostureCallable(c return task->get_future(); } +FacebodyClient::LiquifyFaceOutcome FacebodyClient::liquifyFace(const LiquifyFaceRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return LiquifyFaceOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return LiquifyFaceOutcome(LiquifyFaceResult(outcome.result())); + else + return LiquifyFaceOutcome(outcome.error()); +} + +void FacebodyClient::liquifyFaceAsync(const LiquifyFaceRequest& request, const LiquifyFaceAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, liquifyFace(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +FacebodyClient::LiquifyFaceOutcomeCallable FacebodyClient::liquifyFaceCallable(const LiquifyFaceRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->liquifyFace(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + FacebodyClient::ListBodyDbsOutcome FacebodyClient::listBodyDbs(const ListBodyDbsRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); @@ -2103,6 +2139,42 @@ FacebodyClient::RetouchBodyOutcomeCallable FacebodyClient::retouchBodyCallable(c return task->get_future(); } +FacebodyClient::RetouchSkinOutcome FacebodyClient::retouchSkin(const RetouchSkinRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return RetouchSkinOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return RetouchSkinOutcome(RetouchSkinResult(outcome.result())); + else + return RetouchSkinOutcome(outcome.error()); +} + +void FacebodyClient::retouchSkinAsync(const RetouchSkinRequest& request, const RetouchSkinAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, retouchSkin(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +FacebodyClient::RetouchSkinOutcomeCallable FacebodyClient::retouchSkinCallable(const RetouchSkinRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->retouchSkin(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + FacebodyClient::SearchBodyTraceOutcome FacebodyClient::searchBodyTrace(const SearchBodyTraceRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); diff --git a/facebody/src/model/LiquifyFaceRequest.cc b/facebody/src/model/LiquifyFaceRequest.cc new file mode 100644 index 000000000..372c594f9 --- /dev/null +++ b/facebody/src/model/LiquifyFaceRequest.cc @@ -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 + +using AlibabaCloud::Facebody::Model::LiquifyFaceRequest; + +LiquifyFaceRequest::LiquifyFaceRequest() : + RpcServiceRequest("facebody", "2019-12-30", "LiquifyFace") +{ + setMethod(HttpRequest::Method::Post); +} + +LiquifyFaceRequest::~LiquifyFaceRequest() +{} + +float LiquifyFaceRequest::getSlimDegree()const +{ + return slimDegree_; +} + +void LiquifyFaceRequest::setSlimDegree(float slimDegree) +{ + slimDegree_ = slimDegree; + setBodyParameter("SlimDegree", std::to_string(slimDegree)); +} + +std::string LiquifyFaceRequest::getImageURL()const +{ + return imageURL_; +} + +void LiquifyFaceRequest::setImageURL(const std::string& imageURL) +{ + imageURL_ = imageURL; + setBodyParameter("ImageURL", imageURL); +} + diff --git a/facebody/src/model/LiquifyFaceResult.cc b/facebody/src/model/LiquifyFaceResult.cc new file mode 100644 index 000000000..6717c8e61 --- /dev/null +++ b/facebody/src/model/LiquifyFaceResult.cc @@ -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 +#include + +using namespace AlibabaCloud::Facebody; +using namespace AlibabaCloud::Facebody::Model; + +LiquifyFaceResult::LiquifyFaceResult() : + ServiceResult() +{} + +LiquifyFaceResult::LiquifyFaceResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +LiquifyFaceResult::~LiquifyFaceResult() +{} + +void LiquifyFaceResult::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["ImageURL"].isNull()) + data_.imageURL = dataNode["ImageURL"].asString(); + if(!value["Code"].isNull()) + code_ = value["Code"].asString(); + if(!value["Message"].isNull()) + message_ = value["Message"].asString(); + +} + +std::string LiquifyFaceResult::getMessage()const +{ + return message_; +} + +LiquifyFaceResult::Data LiquifyFaceResult::getData()const +{ + return data_; +} + +std::string LiquifyFaceResult::getCode()const +{ + return code_; +} + diff --git a/facebody/src/model/RetouchSkinRequest.cc b/facebody/src/model/RetouchSkinRequest.cc new file mode 100644 index 000000000..5e3e919d5 --- /dev/null +++ b/facebody/src/model/RetouchSkinRequest.cc @@ -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 + +using AlibabaCloud::Facebody::Model::RetouchSkinRequest; + +RetouchSkinRequest::RetouchSkinRequest() : + RpcServiceRequest("facebody", "2019-12-30", "RetouchSkin") +{ + setMethod(HttpRequest::Method::Post); +} + +RetouchSkinRequest::~RetouchSkinRequest() +{} + +float RetouchSkinRequest::getRetouchDegree()const +{ + return retouchDegree_; +} + +void RetouchSkinRequest::setRetouchDegree(float retouchDegree) +{ + retouchDegree_ = retouchDegree; + setBodyParameter("RetouchDegree", std::to_string(retouchDegree)); +} + +float RetouchSkinRequest::getWhiteningDegree()const +{ + return whiteningDegree_; +} + +void RetouchSkinRequest::setWhiteningDegree(float whiteningDegree) +{ + whiteningDegree_ = whiteningDegree; + setBodyParameter("WhiteningDegree", std::to_string(whiteningDegree)); +} + +std::string RetouchSkinRequest::getImageURL()const +{ + return imageURL_; +} + +void RetouchSkinRequest::setImageURL(const std::string& imageURL) +{ + imageURL_ = imageURL; + setBodyParameter("ImageURL", imageURL); +} + diff --git a/facebody/src/model/RetouchSkinResult.cc b/facebody/src/model/RetouchSkinResult.cc new file mode 100644 index 000000000..ada1e552a --- /dev/null +++ b/facebody/src/model/RetouchSkinResult.cc @@ -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 +#include + +using namespace AlibabaCloud::Facebody; +using namespace AlibabaCloud::Facebody::Model; + +RetouchSkinResult::RetouchSkinResult() : + ServiceResult() +{} + +RetouchSkinResult::RetouchSkinResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +RetouchSkinResult::~RetouchSkinResult() +{} + +void RetouchSkinResult::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["ImageURL"].isNull()) + data_.imageURL = dataNode["ImageURL"].asString(); + if(!value["Code"].isNull()) + code_ = value["Code"].asString(); + if(!value["Message"].isNull()) + message_ = value["Message"].asString(); + +} + +std::string RetouchSkinResult::getMessage()const +{ + return message_; +} + +RetouchSkinResult::Data RetouchSkinResult::getData()const +{ + return data_; +} + +std::string RetouchSkinResult::getCode()const +{ + return code_; +} +