From 61c44f91cc7ea6649128dbe5ac25060f502ba080 Mon Sep 17 00:00:00 2001 From: sdk-team Date: Wed, 11 Mar 2020 15:49:39 +0800 Subject: [PATCH] Add new Api SegmentBody. --- CHANGELOG | 3 + VERSION | 2 +- ivpd/CMakeLists.txt | 4 ++ ivpd/include/alibabacloud/ivpd/IvpdClient.h | 8 +++ .../ivpd/model/RecolorImageRequest.h | 1 + .../ivpd/model/SegmentBodyRequest.h | 48 ++++++++++++++ .../ivpd/model/SegmentBodyResult.h | 59 +++++++++++++++++ ivpd/src/IvpdClient.cc | 36 ++++++++++ ivpd/src/model/ChangeImageSizeRequest.cc | 10 +-- ivpd/src/model/DetectImageElementsRequest.cc | 6 +- ivpd/src/model/ExtendImageStyleRequest.cc | 8 ++- .../model/MakeSuperResolutionImageRequest.cc | 6 +- ivpd/src/model/RecognizeImageColorRequest.cc | 8 ++- ivpd/src/model/RecognizeImageStyleRequest.cc | 6 +- ivpd/src/model/RecolorImageRequest.cc | 21 +++--- ivpd/src/model/SegmentBodyRequest.cc | 40 +++++++++++ ivpd/src/model/SegmentBodyResult.cc | 66 +++++++++++++++++++ ivpd/src/model/SegmentImageRequest.cc | 6 +- 18 files changed, 309 insertions(+), 29 deletions(-) create mode 100644 ivpd/include/alibabacloud/ivpd/model/SegmentBodyRequest.h create mode 100644 ivpd/include/alibabacloud/ivpd/model/SegmentBodyResult.h create mode 100644 ivpd/src/model/SegmentBodyRequest.cc create mode 100644 ivpd/src/model/SegmentBodyResult.cc diff --git a/CHANGELOG b/CHANGELOG index d179ecd67..66a32c691 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2020-03-11 Version: 1.36.315 +- Add new Api SegmentBody. + 2020-03-11 Version: 1.36.314 - Support certificate translate. diff --git a/VERSION b/VERSION index 4d8b3c4a8..14294ada9 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.314 \ No newline at end of file +1.36.315 \ No newline at end of file diff --git a/ivpd/CMakeLists.txt b/ivpd/CMakeLists.txt index 2e2a89bb4..41040d9d9 100644 --- a/ivpd/CMakeLists.txt +++ b/ivpd/CMakeLists.txt @@ -35,6 +35,8 @@ set(ivpd_public_header_model include/alibabacloud/ivpd/model/RecognizeImageStyleResult.h include/alibabacloud/ivpd/model/RecolorImageRequest.h include/alibabacloud/ivpd/model/RecolorImageResult.h + include/alibabacloud/ivpd/model/SegmentBodyRequest.h + include/alibabacloud/ivpd/model/SegmentBodyResult.h include/alibabacloud/ivpd/model/SegmentImageRequest.h include/alibabacloud/ivpd/model/SegmentImageResult.h ) @@ -54,6 +56,8 @@ set(ivpd_src src/model/RecognizeImageStyleResult.cc src/model/RecolorImageRequest.cc src/model/RecolorImageResult.cc + src/model/SegmentBodyRequest.cc + src/model/SegmentBodyResult.cc src/model/SegmentImageRequest.cc src/model/SegmentImageResult.cc ) diff --git a/ivpd/include/alibabacloud/ivpd/IvpdClient.h b/ivpd/include/alibabacloud/ivpd/IvpdClient.h index 3a5442be4..0428c3b23 100644 --- a/ivpd/include/alibabacloud/ivpd/IvpdClient.h +++ b/ivpd/include/alibabacloud/ivpd/IvpdClient.h @@ -36,6 +36,8 @@ #include "model/RecognizeImageStyleResult.h" #include "model/RecolorImageRequest.h" #include "model/RecolorImageResult.h" +#include "model/SegmentBodyRequest.h" +#include "model/SegmentBodyResult.h" #include "model/SegmentImageRequest.h" #include "model/SegmentImageResult.h" @@ -68,6 +70,9 @@ namespace AlibabaCloud typedef Outcome RecolorImageOutcome; typedef std::future RecolorImageOutcomeCallable; typedef std::function&)> RecolorImageAsyncHandler; + typedef Outcome SegmentBodyOutcome; + typedef std::future SegmentBodyOutcomeCallable; + typedef std::function&)> SegmentBodyAsyncHandler; typedef Outcome SegmentImageOutcome; typedef std::future SegmentImageOutcomeCallable; typedef std::function&)> SegmentImageAsyncHandler; @@ -97,6 +102,9 @@ namespace AlibabaCloud RecolorImageOutcome recolorImage(const Model::RecolorImageRequest &request)const; void recolorImageAsync(const Model::RecolorImageRequest& request, const RecolorImageAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; RecolorImageOutcomeCallable recolorImageCallable(const Model::RecolorImageRequest& request) const; + SegmentBodyOutcome segmentBody(const Model::SegmentBodyRequest &request)const; + void segmentBodyAsync(const Model::SegmentBodyRequest& request, const SegmentBodyAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + SegmentBodyOutcomeCallable segmentBodyCallable(const Model::SegmentBodyRequest& request) const; SegmentImageOutcome segmentImage(const Model::SegmentImageRequest &request)const; void segmentImageAsync(const Model::SegmentImageRequest& request, const SegmentImageAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; SegmentImageOutcomeCallable segmentImageCallable(const Model::SegmentImageRequest& request) const; diff --git a/ivpd/include/alibabacloud/ivpd/model/RecolorImageRequest.h b/ivpd/include/alibabacloud/ivpd/model/RecolorImageRequest.h index bf25bc629..4b35a9b71 100644 --- a/ivpd/include/alibabacloud/ivpd/model/RecolorImageRequest.h +++ b/ivpd/include/alibabacloud/ivpd/model/RecolorImageRequest.h @@ -30,6 +30,7 @@ namespace AlibabaCloud { class ALIBABACLOUD_IVPD_EXPORT RecolorImageRequest : public RpcServiceRequest { + public: struct ColorTemplate { std::string color; diff --git a/ivpd/include/alibabacloud/ivpd/model/SegmentBodyRequest.h b/ivpd/include/alibabacloud/ivpd/model/SegmentBodyRequest.h new file mode 100644 index 000000000..800469b3f --- /dev/null +++ b/ivpd/include/alibabacloud/ivpd/model/SegmentBodyRequest.h @@ -0,0 +1,48 @@ +/* + * 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_IVPD_MODEL_SEGMENTBODYREQUEST_H_ +#define ALIBABACLOUD_IVPD_MODEL_SEGMENTBODYREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Ivpd + { + namespace Model + { + class ALIBABACLOUD_IVPD_EXPORT SegmentBodyRequest : public RpcServiceRequest + { + + public: + SegmentBodyRequest(); + ~SegmentBodyRequest(); + + std::string getImageUrl()const; + void setImageUrl(const std::string& imageUrl); + + private: + std::string imageUrl_; + + }; + } + } +} +#endif // !ALIBABACLOUD_IVPD_MODEL_SEGMENTBODYREQUEST_H_ \ No newline at end of file diff --git a/ivpd/include/alibabacloud/ivpd/model/SegmentBodyResult.h b/ivpd/include/alibabacloud/ivpd/model/SegmentBodyResult.h new file mode 100644 index 000000000..90449a4df --- /dev/null +++ b/ivpd/include/alibabacloud/ivpd/model/SegmentBodyResult.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_IVPD_MODEL_SEGMENTBODYRESULT_H_ +#define ALIBABACLOUD_IVPD_MODEL_SEGMENTBODYRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Ivpd + { + namespace Model + { + class ALIBABACLOUD_IVPD_EXPORT SegmentBodyResult : public ServiceResult + { + public: + struct Data + { + std::string imageUrl; + }; + + + SegmentBodyResult(); + explicit SegmentBodyResult(const std::string &payload); + ~SegmentBodyResult(); + 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_IVPD_MODEL_SEGMENTBODYRESULT_H_ \ No newline at end of file diff --git a/ivpd/src/IvpdClient.cc b/ivpd/src/IvpdClient.cc index 9c0241fb9..aa46e29ab 100644 --- a/ivpd/src/IvpdClient.cc +++ b/ivpd/src/IvpdClient.cc @@ -303,6 +303,42 @@ IvpdClient::RecolorImageOutcomeCallable IvpdClient::recolorImageCallable(const R return task->get_future(); } +IvpdClient::SegmentBodyOutcome IvpdClient::segmentBody(const SegmentBodyRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return SegmentBodyOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return SegmentBodyOutcome(SegmentBodyResult(outcome.result())); + else + return SegmentBodyOutcome(outcome.error()); +} + +void IvpdClient::segmentBodyAsync(const SegmentBodyRequest& request, const SegmentBodyAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, segmentBody(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +IvpdClient::SegmentBodyOutcomeCallable IvpdClient::segmentBodyCallable(const SegmentBodyRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->segmentBody(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + IvpdClient::SegmentImageOutcome IvpdClient::segmentImage(const SegmentImageRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); diff --git a/ivpd/src/model/ChangeImageSizeRequest.cc b/ivpd/src/model/ChangeImageSizeRequest.cc index f5368500e..151125bb6 100644 --- a/ivpd/src/model/ChangeImageSizeRequest.cc +++ b/ivpd/src/model/ChangeImageSizeRequest.cc @@ -20,7 +20,9 @@ using AlibabaCloud::Ivpd::Model::ChangeImageSizeRequest; ChangeImageSizeRequest::ChangeImageSizeRequest() : RpcServiceRequest("ivpd", "2019-06-25", "ChangeImageSize") -{} +{ + setMethod(HttpRequest::Method::Post); +} ChangeImageSizeRequest::~ChangeImageSizeRequest() {} @@ -33,7 +35,7 @@ std::string ChangeImageSizeRequest::getUrl()const void ChangeImageSizeRequest::setUrl(const std::string& url) { url_ = url; - setCoreParameter("Url", url); + setBodyParameter("Url", url); } int ChangeImageSizeRequest::getWidth()const @@ -44,7 +46,7 @@ int ChangeImageSizeRequest::getWidth()const void ChangeImageSizeRequest::setWidth(int width) { width_ = width; - setCoreParameter("Width", std::to_string(width)); + setBodyParameter("Width", std::to_string(width)); } int ChangeImageSizeRequest::getHeight()const @@ -55,6 +57,6 @@ int ChangeImageSizeRequest::getHeight()const void ChangeImageSizeRequest::setHeight(int height) { height_ = height; - setCoreParameter("Height", std::to_string(height)); + setBodyParameter("Height", std::to_string(height)); } diff --git a/ivpd/src/model/DetectImageElementsRequest.cc b/ivpd/src/model/DetectImageElementsRequest.cc index 57ccfde82..2d32b79dd 100644 --- a/ivpd/src/model/DetectImageElementsRequest.cc +++ b/ivpd/src/model/DetectImageElementsRequest.cc @@ -20,7 +20,9 @@ using AlibabaCloud::Ivpd::Model::DetectImageElementsRequest; DetectImageElementsRequest::DetectImageElementsRequest() : RpcServiceRequest("ivpd", "2019-06-25", "DetectImageElements") -{} +{ + setMethod(HttpRequest::Method::Post); +} DetectImageElementsRequest::~DetectImageElementsRequest() {} @@ -33,6 +35,6 @@ std::string DetectImageElementsRequest::getUrl()const void DetectImageElementsRequest::setUrl(const std::string& url) { url_ = url; - setCoreParameter("Url", url); + setBodyParameter("Url", url); } diff --git a/ivpd/src/model/ExtendImageStyleRequest.cc b/ivpd/src/model/ExtendImageStyleRequest.cc index c0afd6151..5aaa749d1 100644 --- a/ivpd/src/model/ExtendImageStyleRequest.cc +++ b/ivpd/src/model/ExtendImageStyleRequest.cc @@ -20,7 +20,9 @@ using AlibabaCloud::Ivpd::Model::ExtendImageStyleRequest; ExtendImageStyleRequest::ExtendImageStyleRequest() : RpcServiceRequest("ivpd", "2019-06-25", "ExtendImageStyle") -{} +{ + setMethod(HttpRequest::Method::Post); +} ExtendImageStyleRequest::~ExtendImageStyleRequest() {} @@ -33,7 +35,7 @@ std::string ExtendImageStyleRequest::getMajorUrl()const void ExtendImageStyleRequest::setMajorUrl(const std::string& majorUrl) { majorUrl_ = majorUrl; - setCoreParameter("MajorUrl", majorUrl); + setBodyParameter("MajorUrl", majorUrl); } std::string ExtendImageStyleRequest::getStyleUrl()const @@ -44,6 +46,6 @@ std::string ExtendImageStyleRequest::getStyleUrl()const void ExtendImageStyleRequest::setStyleUrl(const std::string& styleUrl) { styleUrl_ = styleUrl; - setCoreParameter("StyleUrl", styleUrl); + setBodyParameter("StyleUrl", styleUrl); } diff --git a/ivpd/src/model/MakeSuperResolutionImageRequest.cc b/ivpd/src/model/MakeSuperResolutionImageRequest.cc index 00d2cc668..dc46c38cc 100644 --- a/ivpd/src/model/MakeSuperResolutionImageRequest.cc +++ b/ivpd/src/model/MakeSuperResolutionImageRequest.cc @@ -20,7 +20,9 @@ using AlibabaCloud::Ivpd::Model::MakeSuperResolutionImageRequest; MakeSuperResolutionImageRequest::MakeSuperResolutionImageRequest() : RpcServiceRequest("ivpd", "2019-06-25", "MakeSuperResolutionImage") -{} +{ + setMethod(HttpRequest::Method::Post); +} MakeSuperResolutionImageRequest::~MakeSuperResolutionImageRequest() {} @@ -33,6 +35,6 @@ std::string MakeSuperResolutionImageRequest::getUrl()const void MakeSuperResolutionImageRequest::setUrl(const std::string& url) { url_ = url; - setCoreParameter("Url", url); + setBodyParameter("Url", url); } diff --git a/ivpd/src/model/RecognizeImageColorRequest.cc b/ivpd/src/model/RecognizeImageColorRequest.cc index 24a84a84d..5961f33e5 100644 --- a/ivpd/src/model/RecognizeImageColorRequest.cc +++ b/ivpd/src/model/RecognizeImageColorRequest.cc @@ -20,7 +20,9 @@ using AlibabaCloud::Ivpd::Model::RecognizeImageColorRequest; RecognizeImageColorRequest::RecognizeImageColorRequest() : RpcServiceRequest("ivpd", "2019-06-25", "RecognizeImageColor") -{} +{ + setMethod(HttpRequest::Method::Post); +} RecognizeImageColorRequest::~RecognizeImageColorRequest() {} @@ -33,7 +35,7 @@ std::string RecognizeImageColorRequest::getUrl()const void RecognizeImageColorRequest::setUrl(const std::string& url) { url_ = url; - setCoreParameter("Url", url); + setBodyParameter("Url", url); } std::string RecognizeImageColorRequest::getColorCount()const @@ -44,6 +46,6 @@ std::string RecognizeImageColorRequest::getColorCount()const void RecognizeImageColorRequest::setColorCount(const std::string& colorCount) { colorCount_ = colorCount; - setCoreParameter("ColorCount", colorCount); + setBodyParameter("ColorCount", colorCount); } diff --git a/ivpd/src/model/RecognizeImageStyleRequest.cc b/ivpd/src/model/RecognizeImageStyleRequest.cc index 595c80e61..cd172979e 100644 --- a/ivpd/src/model/RecognizeImageStyleRequest.cc +++ b/ivpd/src/model/RecognizeImageStyleRequest.cc @@ -20,7 +20,9 @@ using AlibabaCloud::Ivpd::Model::RecognizeImageStyleRequest; RecognizeImageStyleRequest::RecognizeImageStyleRequest() : RpcServiceRequest("ivpd", "2019-06-25", "RecognizeImageStyle") -{} +{ + setMethod(HttpRequest::Method::Post); +} RecognizeImageStyleRequest::~RecognizeImageStyleRequest() {} @@ -33,6 +35,6 @@ std::string RecognizeImageStyleRequest::getUrl()const void RecognizeImageStyleRequest::setUrl(const std::string& url) { url_ = url; - setCoreParameter("Url", url); + setBodyParameter("Url", url); } diff --git a/ivpd/src/model/RecolorImageRequest.cc b/ivpd/src/model/RecolorImageRequest.cc index e145ec022..67263efe4 100644 --- a/ivpd/src/model/RecolorImageRequest.cc +++ b/ivpd/src/model/RecolorImageRequest.cc @@ -20,7 +20,9 @@ using AlibabaCloud::Ivpd::Model::RecolorImageRequest; RecolorImageRequest::RecolorImageRequest() : RpcServiceRequest("ivpd", "2019-06-25", "RecolorImage") -{} +{ + setMethod(HttpRequest::Method::Post); +} RecolorImageRequest::~RecolorImageRequest() {} @@ -33,11 +35,10 @@ std::vector RecolorImageRequest::getColorTem void RecolorImageRequest::setColorTemplate(const std::vector& colorTemplate) { colorTemplate_ = colorTemplate; - int i = 0; - for(int i = 0; i!= colorTemplate.size(); i++) { - auto obj = colorTemplate.at(i); - std::string str ="ColorTemplate."+ std::to_string(i); - setCoreParameter(str + ".Color", obj.color); + for(int dep1 = 0; dep1!= colorTemplate.size(); dep1++) { + auto colorTemplateObj = colorTemplate.at(dep1); + std::string colorTemplateObjStr = "ColorTemplate." + std::to_string(dep1 + 1); + setParameter(colorTemplateObjStr + ".Color", colorTemplateObj.color); } } @@ -49,7 +50,7 @@ std::string RecolorImageRequest::getUrl()const void RecolorImageRequest::setUrl(const std::string& url) { url_ = url; - setCoreParameter("Url", url); + setBodyParameter("Url", url); } std::string RecolorImageRequest::getMode()const @@ -60,7 +61,7 @@ std::string RecolorImageRequest::getMode()const void RecolorImageRequest::setMode(const std::string& mode) { mode_ = mode; - setCoreParameter("Mode", mode); + setBodyParameter("Mode", mode); } int RecolorImageRequest::getColorCount()const @@ -71,7 +72,7 @@ int RecolorImageRequest::getColorCount()const void RecolorImageRequest::setColorCount(int colorCount) { colorCount_ = colorCount; - setCoreParameter("ColorCount", std::to_string(colorCount)); + setBodyParameter("ColorCount", std::to_string(colorCount)); } std::string RecolorImageRequest::getRefUrl()const @@ -82,6 +83,6 @@ std::string RecolorImageRequest::getRefUrl()const void RecolorImageRequest::setRefUrl(const std::string& refUrl) { refUrl_ = refUrl; - setCoreParameter("RefUrl", refUrl); + setBodyParameter("RefUrl", refUrl); } diff --git a/ivpd/src/model/SegmentBodyRequest.cc b/ivpd/src/model/SegmentBodyRequest.cc new file mode 100644 index 000000000..ac485b6db --- /dev/null +++ b/ivpd/src/model/SegmentBodyRequest.cc @@ -0,0 +1,40 @@ +/* + * 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::Ivpd::Model::SegmentBodyRequest; + +SegmentBodyRequest::SegmentBodyRequest() : + RpcServiceRequest("ivpd", "2019-06-25", "SegmentBody") +{ + setMethod(HttpRequest::Method::Post); +} + +SegmentBodyRequest::~SegmentBodyRequest() +{} + +std::string SegmentBodyRequest::getImageUrl()const +{ + return imageUrl_; +} + +void SegmentBodyRequest::setImageUrl(const std::string& imageUrl) +{ + imageUrl_ = imageUrl; + setBodyParameter("ImageUrl", imageUrl); +} + diff --git a/ivpd/src/model/SegmentBodyResult.cc b/ivpd/src/model/SegmentBodyResult.cc new file mode 100644 index 000000000..c5e515883 --- /dev/null +++ b/ivpd/src/model/SegmentBodyResult.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::Ivpd; +using namespace AlibabaCloud::Ivpd::Model; + +SegmentBodyResult::SegmentBodyResult() : + ServiceResult() +{} + +SegmentBodyResult::SegmentBodyResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +SegmentBodyResult::~SegmentBodyResult() +{} + +void SegmentBodyResult::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 SegmentBodyResult::getMessage()const +{ + return message_; +} + +SegmentBodyResult::Data SegmentBodyResult::getData()const +{ + return data_; +} + +std::string SegmentBodyResult::getCode()const +{ + return code_; +} + diff --git a/ivpd/src/model/SegmentImageRequest.cc b/ivpd/src/model/SegmentImageRequest.cc index 56ba985c6..f0ddc92d5 100644 --- a/ivpd/src/model/SegmentImageRequest.cc +++ b/ivpd/src/model/SegmentImageRequest.cc @@ -20,7 +20,9 @@ using AlibabaCloud::Ivpd::Model::SegmentImageRequest; SegmentImageRequest::SegmentImageRequest() : RpcServiceRequest("ivpd", "2019-06-25", "SegmentImage") -{} +{ + setMethod(HttpRequest::Method::Post); +} SegmentImageRequest::~SegmentImageRequest() {} @@ -33,6 +35,6 @@ std::string SegmentImageRequest::getUrl()const void SegmentImageRequest::setUrl(const std::string& url) { url_ = url; - setCoreParameter("Url", url); + setBodyParameter("Url", url); }