Release TargetVolumeSegment.

This commit is contained in:
sdk-team
2023-02-02 08:42:00 +00:00
parent bad958a4b6
commit c6aa166140
8 changed files with 331 additions and 1 deletions

View File

@@ -61,6 +61,8 @@ set(imageprocess_public_header_model
include/alibabacloud/imageprocess/model/ScreenECResult.h
include/alibabacloud/imageprocess/model/SegmentOARRequest.h
include/alibabacloud/imageprocess/model/SegmentOARResult.h
include/alibabacloud/imageprocess/model/TargetVolumeSegmentRequest.h
include/alibabacloud/imageprocess/model/TargetVolumeSegmentResult.h
include/alibabacloud/imageprocess/model/TranslateMedRequest.h
include/alibabacloud/imageprocess/model/TranslateMedResult.h )
@@ -106,6 +108,8 @@ set(imageprocess_src
src/model/ScreenECResult.cc
src/model/SegmentOARRequest.cc
src/model/SegmentOARResult.cc
src/model/TargetVolumeSegmentRequest.cc
src/model/TargetVolumeSegmentResult.cc
src/model/TranslateMedRequest.cc
src/model/TranslateMedResult.cc )

View File

@@ -62,6 +62,8 @@
#include "model/ScreenECResult.h"
#include "model/SegmentOARRequest.h"
#include "model/SegmentOARResult.h"
#include "model/TargetVolumeSegmentRequest.h"
#include "model/TargetVolumeSegmentResult.h"
#include "model/TranslateMedRequest.h"
#include "model/TranslateMedResult.h"
@@ -133,6 +135,9 @@ namespace AlibabaCloud
typedef Outcome<Error, Model::SegmentOARResult> SegmentOAROutcome;
typedef std::future<SegmentOAROutcome> SegmentOAROutcomeCallable;
typedef std::function<void(const ImageprocessClient*, const Model::SegmentOARRequest&, const SegmentOAROutcome&, const std::shared_ptr<const AsyncCallerContext>&)> SegmentOARAsyncHandler;
typedef Outcome<Error, Model::TargetVolumeSegmentResult> TargetVolumeSegmentOutcome;
typedef std::future<TargetVolumeSegmentOutcome> TargetVolumeSegmentOutcomeCallable;
typedef std::function<void(const ImageprocessClient*, const Model::TargetVolumeSegmentRequest&, const TargetVolumeSegmentOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> TargetVolumeSegmentAsyncHandler;
typedef Outcome<Error, Model::TranslateMedResult> TranslateMedOutcome;
typedef std::future<TranslateMedOutcome> TranslateMedOutcomeCallable;
typedef std::function<void(const ImageprocessClient*, const Model::TranslateMedRequest&, const TranslateMedOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> TranslateMedAsyncHandler;
@@ -201,6 +206,9 @@ namespace AlibabaCloud
SegmentOAROutcome segmentOAR(const Model::SegmentOARRequest &request)const;
void segmentOARAsync(const Model::SegmentOARRequest& request, const SegmentOARAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
SegmentOAROutcomeCallable segmentOARCallable(const Model::SegmentOARRequest& request) const;
TargetVolumeSegmentOutcome targetVolumeSegment(const Model::TargetVolumeSegmentRequest &request)const;
void targetVolumeSegmentAsync(const Model::TargetVolumeSegmentRequest& request, const TargetVolumeSegmentAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
TargetVolumeSegmentOutcomeCallable targetVolumeSegmentCallable(const Model::TargetVolumeSegmentRequest& request) const;
TranslateMedOutcome translateMed(const Model::TranslateMedRequest &request)const;
void translateMedAsync(const Model::TranslateMedRequest& request, const TranslateMedAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
TranslateMedOutcomeCallable translateMedCallable(const Model::TranslateMedRequest& request) const;

View File

@@ -0,0 +1,63 @@
/*
* 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_IMAGEPROCESS_MODEL_TARGETVOLUMESEGMENTREQUEST_H_
#define ALIBABACLOUD_IMAGEPROCESS_MODEL_TARGETVOLUMESEGMENTREQUEST_H_
#include <alibabacloud/imageprocess/ImageprocessExport.h>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <string>
#include <vector>
#include <map>
namespace AlibabaCloud {
namespace Imageprocess {
namespace Model {
class ALIBABACLOUD_IMAGEPROCESS_EXPORT TargetVolumeSegmentRequest : public RpcServiceRequest {
public:
struct URLList {
std::string uRL;
};
TargetVolumeSegmentRequest();
~TargetVolumeSegmentRequest();
std::string getCancerType() const;
void setCancerType(const std::string &cancerType);
std::string getOrgName() const;
void setOrgName(const std::string &orgName);
std::string getTargetVolumeType() const;
void setTargetVolumeType(const std::string &targetVolumeType);
std::string getDataFormat() const;
void setDataFormat(const std::string &dataFormat);
std::vector<URLList> getURLList() const;
void setURLList(const std::vector<URLList> &uRLList);
std::string getOrgId() const;
void setOrgId(const std::string &orgId);
bool getAsync() const;
void setAsync(bool async);
private:
std::string cancerType_;
std::string orgName_;
std::string targetVolumeType_;
std::string dataFormat_;
std::vector<URLList> uRLList_;
std::string orgId_;
bool async_;
};
} // namespace Model
} // namespace Imageprocess
} // namespace AlibabaCloud
#endif // !ALIBABACLOUD_IMAGEPROCESS_MODEL_TARGETVOLUMESEGMENTREQUEST_H_

View File

@@ -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_IMAGEPROCESS_MODEL_TARGETVOLUMESEGMENTRESULT_H_
#define ALIBABACLOUD_IMAGEPROCESS_MODEL_TARGETVOLUMESEGMENTRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/imageprocess/ImageprocessExport.h>
namespace AlibabaCloud
{
namespace Imageprocess
{
namespace Model
{
class ALIBABACLOUD_IMAGEPROCESS_EXPORT TargetVolumeSegmentResult : public ServiceResult
{
public:
struct Data
{
std::string resultURL;
};
TargetVolumeSegmentResult();
explicit TargetVolumeSegmentResult(const std::string &payload);
~TargetVolumeSegmentResult();
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_IMAGEPROCESS_MODEL_TARGETVOLUMESEGMENTRESULT_H_

View File

@@ -771,6 +771,42 @@ ImageprocessClient::SegmentOAROutcomeCallable ImageprocessClient::segmentOARCall
return task->get_future();
}
ImageprocessClient::TargetVolumeSegmentOutcome ImageprocessClient::targetVolumeSegment(const TargetVolumeSegmentRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return TargetVolumeSegmentOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return TargetVolumeSegmentOutcome(TargetVolumeSegmentResult(outcome.result()));
else
return TargetVolumeSegmentOutcome(outcome.error());
}
void ImageprocessClient::targetVolumeSegmentAsync(const TargetVolumeSegmentRequest& request, const TargetVolumeSegmentAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, targetVolumeSegment(request), context);
};
asyncExecute(new Runnable(fn));
}
ImageprocessClient::TargetVolumeSegmentOutcomeCallable ImageprocessClient::targetVolumeSegmentCallable(const TargetVolumeSegmentRequest &request) const
{
auto task = std::make_shared<std::packaged_task<TargetVolumeSegmentOutcome()>>(
[this, request]()
{
return this->targetVolumeSegment(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
ImageprocessClient::TranslateMedOutcome ImageprocessClient::translateMed(const TranslateMedRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();

View File

@@ -0,0 +1,94 @@
/*
* 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/imageprocess/model/TargetVolumeSegmentRequest.h>
using AlibabaCloud::Imageprocess::Model::TargetVolumeSegmentRequest;
TargetVolumeSegmentRequest::TargetVolumeSegmentRequest()
: RpcServiceRequest("imageprocess", "2020-03-20", "TargetVolumeSegment") {
setMethod(HttpRequest::Method::Post);
}
TargetVolumeSegmentRequest::~TargetVolumeSegmentRequest() {}
std::string TargetVolumeSegmentRequest::getCancerType() const {
return cancerType_;
}
void TargetVolumeSegmentRequest::setCancerType(const std::string &cancerType) {
cancerType_ = cancerType;
setBodyParameter(std::string("CancerType"), cancerType);
}
std::string TargetVolumeSegmentRequest::getOrgName() const {
return orgName_;
}
void TargetVolumeSegmentRequest::setOrgName(const std::string &orgName) {
orgName_ = orgName;
setBodyParameter(std::string("OrgName"), orgName);
}
std::string TargetVolumeSegmentRequest::getTargetVolumeType() const {
return targetVolumeType_;
}
void TargetVolumeSegmentRequest::setTargetVolumeType(const std::string &targetVolumeType) {
targetVolumeType_ = targetVolumeType;
setBodyParameter(std::string("TargetVolumeType"), targetVolumeType);
}
std::string TargetVolumeSegmentRequest::getDataFormat() const {
return dataFormat_;
}
void TargetVolumeSegmentRequest::setDataFormat(const std::string &dataFormat) {
dataFormat_ = dataFormat;
setBodyParameter(std::string("DataFormat"), dataFormat);
}
std::vector<TargetVolumeSegmentRequest::URLList> TargetVolumeSegmentRequest::getURLList() const {
return uRLList_;
}
void TargetVolumeSegmentRequest::setURLList(const std::vector<TargetVolumeSegmentRequest::URLList> &uRLList) {
uRLList_ = uRLList;
for(int dep1 = 0; dep1 != uRLList.size(); dep1++) {
auto uRLListObj = uRLList.at(dep1);
std::string uRLListObjStr = std::string("URLList") + "." + std::to_string(dep1 + 1);
setBodyParameter(uRLListObjStr + ".URL", uRLListObj.uRL);
}
}
std::string TargetVolumeSegmentRequest::getOrgId() const {
return orgId_;
}
void TargetVolumeSegmentRequest::setOrgId(const std::string &orgId) {
orgId_ = orgId;
setBodyParameter(std::string("OrgId"), orgId);
}
bool TargetVolumeSegmentRequest::getAsync() const {
return async_;
}
void TargetVolumeSegmentRequest::setAsync(bool async) {
async_ = async;
setBodyParameter(std::string("Async"), async ? "true" : "false");
}

View File

@@ -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 <alibabacloud/imageprocess/model/TargetVolumeSegmentResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Imageprocess;
using namespace AlibabaCloud::Imageprocess::Model;
TargetVolumeSegmentResult::TargetVolumeSegmentResult() :
ServiceResult()
{}
TargetVolumeSegmentResult::TargetVolumeSegmentResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
TargetVolumeSegmentResult::~TargetVolumeSegmentResult()
{}
void TargetVolumeSegmentResult::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["ResultURL"].isNull())
data_.resultURL = dataNode["ResultURL"].asString();
if(!value["Code"].isNull())
code_ = value["Code"].asString();
if(!value["Message"].isNull())
message_ = value["Message"].asString();
}
std::string TargetVolumeSegmentResult::getMessage()const
{
return message_;
}
TargetVolumeSegmentResult::Data TargetVolumeSegmentResult::getData()const
{
return data_;
}
std::string TargetVolumeSegmentResult::getCode()const
{
return code_;
}