Release DetectKneeXRay DetectSpineMRI TranslateMed.

This commit is contained in:
sdk-team
2020-08-13 16:38:17 +08:00
parent 83f2c53623
commit 41ea6f3a12
30 changed files with 1905 additions and 1 deletions

View File

@@ -0,0 +1,269 @@
/*
* 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/ImageprocessClient.h>
#include <alibabacloud/core/SimpleCredentialsProvider.h>
using namespace AlibabaCloud;
using namespace AlibabaCloud::Location;
using namespace AlibabaCloud::Imageprocess;
using namespace AlibabaCloud::Imageprocess::Model;
namespace
{
const std::string SERVICE_NAME = "imageprocess";
}
ImageprocessClient::ImageprocessClient(const Credentials &credentials, const ClientConfiguration &configuration) :
RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(credentials), configuration)
{
auto locationClient = std::make_shared<LocationClient>(credentials, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "imageprocess");
}
ImageprocessClient::ImageprocessClient(const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) :
RpcServiceClient(SERVICE_NAME, credentialsProvider, configuration)
{
auto locationClient = std::make_shared<LocationClient>(credentialsProvider, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "imageprocess");
}
ImageprocessClient::ImageprocessClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) :
RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(accessKeyId, accessKeySecret), configuration)
{
auto locationClient = std::make_shared<LocationClient>(accessKeyId, accessKeySecret, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "imageprocess");
}
ImageprocessClient::~ImageprocessClient()
{}
ImageprocessClient::DetectCovid19CadOutcome ImageprocessClient::detectCovid19Cad(const DetectCovid19CadRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return DetectCovid19CadOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return DetectCovid19CadOutcome(DetectCovid19CadResult(outcome.result()));
else
return DetectCovid19CadOutcome(outcome.error());
}
void ImageprocessClient::detectCovid19CadAsync(const DetectCovid19CadRequest& request, const DetectCovid19CadAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, detectCovid19Cad(request), context);
};
asyncExecute(new Runnable(fn));
}
ImageprocessClient::DetectCovid19CadOutcomeCallable ImageprocessClient::detectCovid19CadCallable(const DetectCovid19CadRequest &request) const
{
auto task = std::make_shared<std::packaged_task<DetectCovid19CadOutcome()>>(
[this, request]()
{
return this->detectCovid19Cad(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
ImageprocessClient::DetectKneeXRayOutcome ImageprocessClient::detectKneeXRay(const DetectKneeXRayRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return DetectKneeXRayOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return DetectKneeXRayOutcome(DetectKneeXRayResult(outcome.result()));
else
return DetectKneeXRayOutcome(outcome.error());
}
void ImageprocessClient::detectKneeXRayAsync(const DetectKneeXRayRequest& request, const DetectKneeXRayAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, detectKneeXRay(request), context);
};
asyncExecute(new Runnable(fn));
}
ImageprocessClient::DetectKneeXRayOutcomeCallable ImageprocessClient::detectKneeXRayCallable(const DetectKneeXRayRequest &request) const
{
auto task = std::make_shared<std::packaged_task<DetectKneeXRayOutcome()>>(
[this, request]()
{
return this->detectKneeXRay(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
ImageprocessClient::DetectLungNoduleOutcome ImageprocessClient::detectLungNodule(const DetectLungNoduleRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return DetectLungNoduleOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return DetectLungNoduleOutcome(DetectLungNoduleResult(outcome.result()));
else
return DetectLungNoduleOutcome(outcome.error());
}
void ImageprocessClient::detectLungNoduleAsync(const DetectLungNoduleRequest& request, const DetectLungNoduleAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, detectLungNodule(request), context);
};
asyncExecute(new Runnable(fn));
}
ImageprocessClient::DetectLungNoduleOutcomeCallable ImageprocessClient::detectLungNoduleCallable(const DetectLungNoduleRequest &request) const
{
auto task = std::make_shared<std::packaged_task<DetectLungNoduleOutcome()>>(
[this, request]()
{
return this->detectLungNodule(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
ImageprocessClient::DetectSpineMRIOutcome ImageprocessClient::detectSpineMRI(const DetectSpineMRIRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return DetectSpineMRIOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return DetectSpineMRIOutcome(DetectSpineMRIResult(outcome.result()));
else
return DetectSpineMRIOutcome(outcome.error());
}
void ImageprocessClient::detectSpineMRIAsync(const DetectSpineMRIRequest& request, const DetectSpineMRIAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, detectSpineMRI(request), context);
};
asyncExecute(new Runnable(fn));
}
ImageprocessClient::DetectSpineMRIOutcomeCallable ImageprocessClient::detectSpineMRICallable(const DetectSpineMRIRequest &request) const
{
auto task = std::make_shared<std::packaged_task<DetectSpineMRIOutcome()>>(
[this, request]()
{
return this->detectSpineMRI(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
ImageprocessClient::GetAsyncJobResultOutcome ImageprocessClient::getAsyncJobResult(const GetAsyncJobResultRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return GetAsyncJobResultOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return GetAsyncJobResultOutcome(GetAsyncJobResultResult(outcome.result()));
else
return GetAsyncJobResultOutcome(outcome.error());
}
void ImageprocessClient::getAsyncJobResultAsync(const GetAsyncJobResultRequest& request, const GetAsyncJobResultAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, getAsyncJobResult(request), context);
};
asyncExecute(new Runnable(fn));
}
ImageprocessClient::GetAsyncJobResultOutcomeCallable ImageprocessClient::getAsyncJobResultCallable(const GetAsyncJobResultRequest &request) const
{
auto task = std::make_shared<std::packaged_task<GetAsyncJobResultOutcome()>>(
[this, request]()
{
return this->getAsyncJobResult(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
ImageprocessClient::TranslateMedOutcome ImageprocessClient::translateMed(const TranslateMedRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return TranslateMedOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return TranslateMedOutcome(TranslateMedResult(outcome.result()));
else
return TranslateMedOutcome(outcome.error());
}
void ImageprocessClient::translateMedAsync(const TranslateMedRequest& request, const TranslateMedAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, translateMed(request), context);
};
asyncExecute(new Runnable(fn));
}
ImageprocessClient::TranslateMedOutcomeCallable ImageprocessClient::translateMedCallable(const TranslateMedRequest &request) const
{
auto task = std::make_shared<std::packaged_task<TranslateMedOutcome()>>(
[this, request]()
{
return this->translateMed(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}

View File

@@ -0,0 +1,55 @@
/*
* 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/DetectCovid19CadRequest.h>
using AlibabaCloud::Imageprocess::Model::DetectCovid19CadRequest;
DetectCovid19CadRequest::DetectCovid19CadRequest() :
RpcServiceRequest("imageprocess", "2020-03-20", "DetectCovid19Cad")
{
setMethod(HttpRequest::Method::Post);
}
DetectCovid19CadRequest::~DetectCovid19CadRequest()
{}
std::vector<DetectCovid19CadRequest::URLList> DetectCovid19CadRequest::getURLList()const
{
return uRLList_;
}
void DetectCovid19CadRequest::setURLList(const std::vector<URLList>& uRLList)
{
uRLList_ = uRLList;
for(int dep1 = 0; dep1!= uRLList.size(); dep1++) {
auto uRLListObj = uRLList.at(dep1);
std::string uRLListObjStr = "URLList." + std::to_string(dep1 + 1);
setParameter(uRLListObjStr + ".URL", uRLListObj.uRL);
}
}
bool DetectCovid19CadRequest::getAsync()const
{
return async_;
}
void DetectCovid19CadRequest::setAsync(bool async)
{
async_ = async;
setBodyParameter("Async", async ? "true" : "false");
}

View File

@@ -0,0 +1,60 @@
/*
* 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/DetectCovid19CadResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Imageprocess;
using namespace AlibabaCloud::Imageprocess::Model;
DetectCovid19CadResult::DetectCovid19CadResult() :
ServiceResult()
{}
DetectCovid19CadResult::DetectCovid19CadResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
DetectCovid19CadResult::~DetectCovid19CadResult()
{}
void DetectCovid19CadResult::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["NewProbability"].isNull())
data_.newProbability = dataNode["NewProbability"].asString();
if(!dataNode["NormalProbability"].isNull())
data_.normalProbability = dataNode["NormalProbability"].asString();
if(!dataNode["OtherProbability"].isNull())
data_.otherProbability = dataNode["OtherProbability"].asString();
if(!dataNode["LesionRatio"].isNull())
data_.lesionRatio = dataNode["LesionRatio"].asString();
if(!dataNode["Mask"].isNull())
data_.mask = dataNode["Mask"].asString();
}
DetectCovid19CadResult::Data DetectCovid19CadResult::getData()const
{
return data_;
}

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/imageprocess/model/DetectKneeXRayRequest.h>
using AlibabaCloud::Imageprocess::Model::DetectKneeXRayRequest;
DetectKneeXRayRequest::DetectKneeXRayRequest() :
RpcServiceRequest("imageprocess", "2020-03-20", "DetectKneeXRay")
{
setMethod(HttpRequest::Method::Post);
}
DetectKneeXRayRequest::~DetectKneeXRayRequest()
{}
std::string DetectKneeXRayRequest::getDataFormat()const
{
return dataFormat_;
}
void DetectKneeXRayRequest::setDataFormat(const std::string& dataFormat)
{
dataFormat_ = dataFormat;
setBodyParameter("DataFormat", dataFormat);
}
std::string DetectKneeXRayRequest::getUrl()const
{
return url_;
}
void DetectKneeXRayRequest::setUrl(const std::string& url)
{
url_ = url;
setBodyParameter("Url", url);
}

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.
*/
#include <alibabacloud/imageprocess/model/DetectKneeXRayResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Imageprocess;
using namespace AlibabaCloud::Imageprocess::Model;
DetectKneeXRayResult::DetectKneeXRayResult() :
ServiceResult()
{}
DetectKneeXRayResult::DetectKneeXRayResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
DetectKneeXRayResult::~DetectKneeXRayResult()
{}
void DetectKneeXRayResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto dataNode = value["Data"];
auto allKLDetectionsNode = dataNode["KLDetections"]["KLDetectionsItem"];
for (auto dataNodeKLDetectionsKLDetectionsItem : allKLDetectionsNode)
{
Data::KLDetectionsItem kLDetectionsItemObject;
auto allDetections = value["Detections"]["Detections"];
for (auto value : allDetections)
kLDetectionsItemObject.detections.push_back(value.asString());
data_.kLDetections.push_back(kLDetectionsItemObject);
}
}
DetectKneeXRayResult::Data DetectKneeXRayResult::getData()const
{
return data_;
}

View File

@@ -0,0 +1,55 @@
/*
* 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/DetectLungNoduleRequest.h>
using AlibabaCloud::Imageprocess::Model::DetectLungNoduleRequest;
DetectLungNoduleRequest::DetectLungNoduleRequest() :
RpcServiceRequest("imageprocess", "2020-03-20", "DetectLungNodule")
{
setMethod(HttpRequest::Method::Post);
}
DetectLungNoduleRequest::~DetectLungNoduleRequest()
{}
std::vector<DetectLungNoduleRequest::URLList> DetectLungNoduleRequest::getURLList()const
{
return uRLList_;
}
void DetectLungNoduleRequest::setURLList(const std::vector<URLList>& uRLList)
{
uRLList_ = uRLList;
for(int dep1 = 0; dep1!= uRLList.size(); dep1++) {
auto uRLListObj = uRLList.at(dep1);
std::string uRLListObjStr = "URLList." + std::to_string(dep1 + 1);
setParameter(uRLListObjStr + ".URL", uRLListObj.uRL);
}
}
bool DetectLungNoduleRequest::getAsync()const
{
return async_;
}
void DetectLungNoduleRequest::setAsync(bool async)
{
async_ = async;
setBodyParameter("Async", async ? "true" : "false");
}

View File

@@ -0,0 +1,80 @@
/*
* 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/DetectLungNoduleResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Imageprocess;
using namespace AlibabaCloud::Imageprocess::Model;
DetectLungNoduleResult::DetectLungNoduleResult() :
ServiceResult()
{}
DetectLungNoduleResult::DetectLungNoduleResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
DetectLungNoduleResult::~DetectLungNoduleResult()
{}
void DetectLungNoduleResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto dataNode = value["Data"];
auto allSeriesNode = dataNode["Series"]["Serie"];
for (auto dataNodeSeriesSerie : allSeriesNode)
{
Data::Serie serieObject;
if(!dataNodeSeriesSerie["SeriesInstanceUid"].isNull())
serieObject.seriesInstanceUid = dataNodeSeriesSerie["SeriesInstanceUid"].asString();
auto allElementsNode = allSeriesNode["Elements"]["Element"];
for (auto allSeriesNodeElementsElement : allElementsNode)
{
Data::Serie::Element elementsObject;
if(!allSeriesNodeElementsElement["Category"].isNull())
elementsObject.category = allSeriesNodeElementsElement["Category"].asString();
if(!allSeriesNodeElementsElement["Confidence"].isNull())
elementsObject.confidence = std::stof(allSeriesNodeElementsElement["Confidence"].asString());
if(!allSeriesNodeElementsElement["Diameter"].isNull())
elementsObject.diameter = std::stof(allSeriesNodeElementsElement["Diameter"].asString());
if(!allSeriesNodeElementsElement["Lobe"].isNull())
elementsObject.lobe = allSeriesNodeElementsElement["Lobe"].asString();
if(!allSeriesNodeElementsElement["Lung"].isNull())
elementsObject.lung = allSeriesNodeElementsElement["Lung"].asString();
if(!allSeriesNodeElementsElement["X"].isNull())
elementsObject.x = std::stof(allSeriesNodeElementsElement["X"].asString());
if(!allSeriesNodeElementsElement["Z"].isNull())
elementsObject.z = std::stof(allSeriesNodeElementsElement["Z"].asString());
if(!allSeriesNodeElementsElement["Y"].isNull())
elementsObject.y = std::stof(allSeriesNodeElementsElement["Y"].asString());
serieObject.elements.push_back(elementsObject);
}
data_.series.push_back(serieObject);
}
}
DetectLungNoduleResult::Data DetectLungNoduleResult::getData()const
{
return data_;
}

View File

@@ -0,0 +1,44 @@
/*
* 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/DetectSpineMRIRequest.h>
using AlibabaCloud::Imageprocess::Model::DetectSpineMRIRequest;
DetectSpineMRIRequest::DetectSpineMRIRequest() :
RpcServiceRequest("imageprocess", "2020-03-20", "DetectSpineMRI")
{
setMethod(HttpRequest::Method::Post);
}
DetectSpineMRIRequest::~DetectSpineMRIRequest()
{}
std::vector<DetectSpineMRIRequest::URLList> DetectSpineMRIRequest::getURLList()const
{
return uRLList_;
}
void DetectSpineMRIRequest::setURLList(const std::vector<URLList>& uRLList)
{
uRLList_ = uRLList;
for(int dep1 = 0; dep1!= uRLList.size(); dep1++) {
auto uRLListObj = uRLList.at(dep1);
std::string uRLListObjStr = "URLList." + std::to_string(dep1 + 1);
setParameter(uRLListObjStr + ".URL", uRLListObj.uRL);
}
}

View File

@@ -0,0 +1,76 @@
/*
* 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/DetectSpineMRIResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Imageprocess;
using namespace AlibabaCloud::Imageprocess::Model;
DetectSpineMRIResult::DetectSpineMRIResult() :
ServiceResult()
{}
DetectSpineMRIResult::DetectSpineMRIResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
DetectSpineMRIResult::~DetectSpineMRIResult()
{}
void DetectSpineMRIResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto dataNode = value["Data"];
auto allDiscsNode = dataNode["Discs"]["Disc"];
for (auto dataNodeDiscsDisc : allDiscsNode)
{
Data::Disc discObject;
if(!dataNodeDiscsDisc["Disease"].isNull())
discObject.disease = dataNodeDiscsDisc["Disease"].asString();
if(!dataNodeDiscsDisc["Identification"].isNull())
discObject.identification = dataNodeDiscsDisc["Identification"].asString();
auto allLocation = value["Location"]["Location"];
for (auto value : allLocation)
discObject.location.push_back(value.asString());
data_.discs.push_back(discObject);
}
auto allVertebrasNode = dataNode["Vertebras"]["Vertebra"];
for (auto dataNodeVertebrasVertebra : allVertebrasNode)
{
Data::Vertebra vertebraObject;
if(!dataNodeVertebrasVertebra["Disease"].isNull())
vertebraObject.disease = dataNodeVertebrasVertebra["Disease"].asString();
if(!dataNodeVertebrasVertebra["Identification"].isNull())
vertebraObject.identification = dataNodeVertebrasVertebra["Identification"].asString();
auto allLocation1 = value["Location"]["Location"];
for (auto value : allLocation1)
vertebraObject.location1.push_back(value.asString());
data_.vertebras.push_back(vertebraObject);
}
}
DetectSpineMRIResult::Data DetectSpineMRIResult::getData()const
{
return data_;
}

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/imageprocess/model/GetAsyncJobResultRequest.h>
using AlibabaCloud::Imageprocess::Model::GetAsyncJobResultRequest;
GetAsyncJobResultRequest::GetAsyncJobResultRequest() :
RpcServiceRequest("imageprocess", "2020-03-20", "GetAsyncJobResult")
{
setMethod(HttpRequest::Method::Post);
}
GetAsyncJobResultRequest::~GetAsyncJobResultRequest()
{}
bool GetAsyncJobResultRequest::getAsync()const
{
return async_;
}
void GetAsyncJobResultRequest::setAsync(bool async)
{
async_ = async;
setBodyParameter("Async", async ? "true" : "false");
}
std::string GetAsyncJobResultRequest::getJobId()const
{
return jobId_;
}
void GetAsyncJobResultRequest::setJobId(const std::string& jobId)
{
jobId_ = jobId;
setBodyParameter("JobId", jobId);
}

View File

@@ -0,0 +1,60 @@
/*
* 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/GetAsyncJobResultResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Imageprocess;
using namespace AlibabaCloud::Imageprocess::Model;
GetAsyncJobResultResult::GetAsyncJobResultResult() :
ServiceResult()
{}
GetAsyncJobResultResult::GetAsyncJobResultResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
GetAsyncJobResultResult::~GetAsyncJobResultResult()
{}
void GetAsyncJobResultResult::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["JobId"].isNull())
data_.jobId = dataNode["JobId"].asString();
if(!dataNode["Status"].isNull())
data_.status = dataNode["Status"].asString();
if(!dataNode["Result"].isNull())
data_.result = dataNode["Result"].asString();
if(!dataNode["ErrorCode"].isNull())
data_.errorCode = dataNode["ErrorCode"].asString();
if(!dataNode["ErrorMessage"].isNull())
data_.errorMessage = dataNode["ErrorMessage"].asString();
}
GetAsyncJobResultResult::Data GetAsyncJobResultResult::getData()const
{
return data_;
}

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/imageprocess/model/TranslateMedRequest.h>
using AlibabaCloud::Imageprocess::Model::TranslateMedRequest;
TranslateMedRequest::TranslateMedRequest() :
RpcServiceRequest("imageprocess", "2020-03-20", "TranslateMed")
{
setMethod(HttpRequest::Method::Post);
}
TranslateMedRequest::~TranslateMedRequest()
{}
std::string TranslateMedRequest::getFromLanguage()const
{
return fromLanguage_;
}
void TranslateMedRequest::setFromLanguage(const std::string& fromLanguage)
{
fromLanguage_ = fromLanguage;
setBodyParameter("FromLanguage", fromLanguage);
}
std::string TranslateMedRequest::getToLanguage()const
{
return toLanguage_;
}
void TranslateMedRequest::setToLanguage(const std::string& toLanguage)
{
toLanguage_ = toLanguage;
setBodyParameter("ToLanguage", toLanguage);
}
std::string TranslateMedRequest::getText()const
{
return text_;
}
void TranslateMedRequest::setText(const std::string& text)
{
text_ = text;
setBodyParameter("Text", text);
}

View File

@@ -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.
*/
#include <alibabacloud/imageprocess/model/TranslateMedResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Imageprocess;
using namespace AlibabaCloud::Imageprocess::Model;
TranslateMedResult::TranslateMedResult() :
ServiceResult()
{}
TranslateMedResult::TranslateMedResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
TranslateMedResult::~TranslateMedResult()
{}
void TranslateMedResult::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["Text"].isNull())
data_.text = dataNode["Text"].asString();
if(!dataNode["Words"].isNull())
data_.words = std::stol(dataNode["Words"].asString());
}
TranslateMedResult::Data TranslateMedResult::getData()const
{
return data_;
}