DocumentInit.
This commit is contained in:
233
documentautoml/src/DocumentAutomlClient.cc
Normal file
233
documentautoml/src/DocumentAutomlClient.cc
Normal file
@@ -0,0 +1,233 @@
|
||||
/*
|
||||
* 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/documentautoml/DocumentAutomlClient.h>
|
||||
#include <alibabacloud/core/SimpleCredentialsProvider.h>
|
||||
|
||||
using namespace AlibabaCloud;
|
||||
using namespace AlibabaCloud::Location;
|
||||
using namespace AlibabaCloud::DocumentAutoml;
|
||||
using namespace AlibabaCloud::DocumentAutoml::Model;
|
||||
|
||||
namespace
|
||||
{
|
||||
const std::string SERVICE_NAME = "documentAutoml";
|
||||
}
|
||||
|
||||
DocumentAutomlClient::DocumentAutomlClient(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, "documentAutoml");
|
||||
}
|
||||
|
||||
DocumentAutomlClient::DocumentAutomlClient(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, "documentAutoml");
|
||||
}
|
||||
|
||||
DocumentAutomlClient::DocumentAutomlClient(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, "documentAutoml");
|
||||
}
|
||||
|
||||
DocumentAutomlClient::~DocumentAutomlClient()
|
||||
{}
|
||||
|
||||
DocumentAutomlClient::CreateModelAsyncPredictOutcome DocumentAutomlClient::createModelAsyncPredict(const CreateModelAsyncPredictRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return CreateModelAsyncPredictOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return CreateModelAsyncPredictOutcome(CreateModelAsyncPredictResult(outcome.result()));
|
||||
else
|
||||
return CreateModelAsyncPredictOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void DocumentAutomlClient::createModelAsyncPredictAsync(const CreateModelAsyncPredictRequest& request, const CreateModelAsyncPredictAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, createModelAsyncPredict(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
DocumentAutomlClient::CreateModelAsyncPredictOutcomeCallable DocumentAutomlClient::createModelAsyncPredictCallable(const CreateModelAsyncPredictRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<CreateModelAsyncPredictOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->createModelAsyncPredict(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
DocumentAutomlClient::GetModelAsyncPredictOutcome DocumentAutomlClient::getModelAsyncPredict(const GetModelAsyncPredictRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return GetModelAsyncPredictOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return GetModelAsyncPredictOutcome(GetModelAsyncPredictResult(outcome.result()));
|
||||
else
|
||||
return GetModelAsyncPredictOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void DocumentAutomlClient::getModelAsyncPredictAsync(const GetModelAsyncPredictRequest& request, const GetModelAsyncPredictAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, getModelAsyncPredict(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
DocumentAutomlClient::GetModelAsyncPredictOutcomeCallable DocumentAutomlClient::getModelAsyncPredictCallable(const GetModelAsyncPredictRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<GetModelAsyncPredictOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->getModelAsyncPredict(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
DocumentAutomlClient::PredictClassifierModelOutcome DocumentAutomlClient::predictClassifierModel(const PredictClassifierModelRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return PredictClassifierModelOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return PredictClassifierModelOutcome(PredictClassifierModelResult(outcome.result()));
|
||||
else
|
||||
return PredictClassifierModelOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void DocumentAutomlClient::predictClassifierModelAsync(const PredictClassifierModelRequest& request, const PredictClassifierModelAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, predictClassifierModel(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
DocumentAutomlClient::PredictClassifierModelOutcomeCallable DocumentAutomlClient::predictClassifierModelCallable(const PredictClassifierModelRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<PredictClassifierModelOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->predictClassifierModel(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
DocumentAutomlClient::PredictModelOutcome DocumentAutomlClient::predictModel(const PredictModelRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return PredictModelOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return PredictModelOutcome(PredictModelResult(outcome.result()));
|
||||
else
|
||||
return PredictModelOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void DocumentAutomlClient::predictModelAsync(const PredictModelRequest& request, const PredictModelAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, predictModel(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
DocumentAutomlClient::PredictModelOutcomeCallable DocumentAutomlClient::predictModelCallable(const PredictModelRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<PredictModelOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->predictModel(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
DocumentAutomlClient::PredictTemplateModelOutcome DocumentAutomlClient::predictTemplateModel(const PredictTemplateModelRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return PredictTemplateModelOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return PredictTemplateModelOutcome(PredictTemplateModelResult(outcome.result()));
|
||||
else
|
||||
return PredictTemplateModelOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void DocumentAutomlClient::predictTemplateModelAsync(const PredictTemplateModelRequest& request, const PredictTemplateModelAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, predictTemplateModel(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
DocumentAutomlClient::PredictTemplateModelOutcomeCallable DocumentAutomlClient::predictTemplateModelCallable(const PredictTemplateModelRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<PredictTemplateModelOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->predictTemplateModel(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
99
documentautoml/src/model/CreateModelAsyncPredictRequest.cc
Normal file
99
documentautoml/src/model/CreateModelAsyncPredictRequest.cc
Normal file
@@ -0,0 +1,99 @@
|
||||
/*
|
||||
* 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/documentautoml/model/CreateModelAsyncPredictRequest.h>
|
||||
|
||||
using AlibabaCloud::DocumentAutoml::Model::CreateModelAsyncPredictRequest;
|
||||
|
||||
CreateModelAsyncPredictRequest::CreateModelAsyncPredictRequest()
|
||||
: RpcServiceRequest("documentautoml", "2022-12-29", "CreateModelAsyncPredict") {
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
CreateModelAsyncPredictRequest::~CreateModelAsyncPredictRequest() {}
|
||||
|
||||
std::string CreateModelAsyncPredictRequest::getBody() const {
|
||||
return body_;
|
||||
}
|
||||
|
||||
void CreateModelAsyncPredictRequest::setBody(const std::string &body) {
|
||||
body_ = body;
|
||||
setBodyParameter(std::string("body"), body);
|
||||
}
|
||||
|
||||
bool CreateModelAsyncPredictRequest::getBinaryToText() const {
|
||||
return binaryToText_;
|
||||
}
|
||||
|
||||
void CreateModelAsyncPredictRequest::setBinaryToText(bool binaryToText) {
|
||||
binaryToText_ = binaryToText;
|
||||
setParameter(std::string("BinaryToText"), binaryToText ? "true" : "false");
|
||||
}
|
||||
|
||||
std::string CreateModelAsyncPredictRequest::getContent() const {
|
||||
return content_;
|
||||
}
|
||||
|
||||
void CreateModelAsyncPredictRequest::setContent(const std::string &content) {
|
||||
content_ = content;
|
||||
setParameter(std::string("Content"), content);
|
||||
}
|
||||
|
||||
std::string CreateModelAsyncPredictRequest::getServiceName() const {
|
||||
return serviceName_;
|
||||
}
|
||||
|
||||
void CreateModelAsyncPredictRequest::setServiceName(const std::string &serviceName) {
|
||||
serviceName_ = serviceName;
|
||||
setParameter(std::string("ServiceName"), serviceName);
|
||||
}
|
||||
|
||||
std::string CreateModelAsyncPredictRequest::getProduct() const {
|
||||
return product_;
|
||||
}
|
||||
|
||||
void CreateModelAsyncPredictRequest::setProduct(const std::string &product) {
|
||||
product_ = product;
|
||||
setParameter(std::string("Product"), product);
|
||||
}
|
||||
|
||||
long CreateModelAsyncPredictRequest::getModelId() const {
|
||||
return modelId_;
|
||||
}
|
||||
|
||||
void CreateModelAsyncPredictRequest::setModelId(long modelId) {
|
||||
modelId_ = modelId;
|
||||
setParameter(std::string("ModelId"), std::to_string(modelId));
|
||||
}
|
||||
|
||||
std::string CreateModelAsyncPredictRequest::getServiceVersion() const {
|
||||
return serviceVersion_;
|
||||
}
|
||||
|
||||
void CreateModelAsyncPredictRequest::setServiceVersion(const std::string &serviceVersion) {
|
||||
serviceVersion_ = serviceVersion;
|
||||
setParameter(std::string("ServiceVersion"), serviceVersion);
|
||||
}
|
||||
|
||||
std::string CreateModelAsyncPredictRequest::getModelVersion() const {
|
||||
return modelVersion_;
|
||||
}
|
||||
|
||||
void CreateModelAsyncPredictRequest::setModelVersion(const std::string &modelVersion) {
|
||||
modelVersion_ = modelVersion;
|
||||
setParameter(std::string("ModelVersion"), modelVersion);
|
||||
}
|
||||
|
||||
65
documentautoml/src/model/CreateModelAsyncPredictResult.cc
Normal file
65
documentautoml/src/model/CreateModelAsyncPredictResult.cc
Normal file
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* 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/documentautoml/model/CreateModelAsyncPredictResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::DocumentAutoml;
|
||||
using namespace AlibabaCloud::DocumentAutoml::Model;
|
||||
|
||||
CreateModelAsyncPredictResult::CreateModelAsyncPredictResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
CreateModelAsyncPredictResult::CreateModelAsyncPredictResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
CreateModelAsyncPredictResult::~CreateModelAsyncPredictResult()
|
||||
{}
|
||||
|
||||
void CreateModelAsyncPredictResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["Code"].isNull())
|
||||
code_ = std::stoi(value["Code"].asString());
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
if(!value["Data"].isNull())
|
||||
data_ = value["Data"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string CreateModelAsyncPredictResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
std::string CreateModelAsyncPredictResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
int CreateModelAsyncPredictResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
45
documentautoml/src/model/GetModelAsyncPredictRequest.cc
Normal file
45
documentautoml/src/model/GetModelAsyncPredictRequest.cc
Normal file
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* 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/documentautoml/model/GetModelAsyncPredictRequest.h>
|
||||
|
||||
using AlibabaCloud::DocumentAutoml::Model::GetModelAsyncPredictRequest;
|
||||
|
||||
GetModelAsyncPredictRequest::GetModelAsyncPredictRequest()
|
||||
: RpcServiceRequest("documentautoml", "2022-12-29", "GetModelAsyncPredict") {
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
GetModelAsyncPredictRequest::~GetModelAsyncPredictRequest() {}
|
||||
|
||||
long GetModelAsyncPredictRequest::getAsyncPredictId() const {
|
||||
return asyncPredictId_;
|
||||
}
|
||||
|
||||
void GetModelAsyncPredictRequest::setAsyncPredictId(long asyncPredictId) {
|
||||
asyncPredictId_ = asyncPredictId;
|
||||
setParameter(std::string("AsyncPredictId"), std::to_string(asyncPredictId));
|
||||
}
|
||||
|
||||
std::string GetModelAsyncPredictRequest::getProduct() const {
|
||||
return product_;
|
||||
}
|
||||
|
||||
void GetModelAsyncPredictRequest::setProduct(const std::string &product) {
|
||||
product_ = product;
|
||||
setParameter(std::string("Product"), product);
|
||||
}
|
||||
|
||||
65
documentautoml/src/model/GetModelAsyncPredictResult.cc
Normal file
65
documentautoml/src/model/GetModelAsyncPredictResult.cc
Normal file
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* 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/documentautoml/model/GetModelAsyncPredictResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::DocumentAutoml;
|
||||
using namespace AlibabaCloud::DocumentAutoml::Model;
|
||||
|
||||
GetModelAsyncPredictResult::GetModelAsyncPredictResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
GetModelAsyncPredictResult::GetModelAsyncPredictResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
GetModelAsyncPredictResult::~GetModelAsyncPredictResult()
|
||||
{}
|
||||
|
||||
void GetModelAsyncPredictResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["Code"].isNull())
|
||||
code_ = std::stoi(value["Code"].asString());
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
if(!value["Data"].isNull())
|
||||
data_ = value["Data"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string GetModelAsyncPredictResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
std::string GetModelAsyncPredictResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
int GetModelAsyncPredictResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
63
documentautoml/src/model/PredictClassifierModelRequest.cc
Normal file
63
documentautoml/src/model/PredictClassifierModelRequest.cc
Normal 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.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/documentautoml/model/PredictClassifierModelRequest.h>
|
||||
|
||||
using AlibabaCloud::DocumentAutoml::Model::PredictClassifierModelRequest;
|
||||
|
||||
PredictClassifierModelRequest::PredictClassifierModelRequest()
|
||||
: RpcServiceRequest("documentautoml", "2022-12-29", "PredictClassifierModel") {
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
PredictClassifierModelRequest::~PredictClassifierModelRequest() {}
|
||||
|
||||
std::string PredictClassifierModelRequest::getBody() const {
|
||||
return body_;
|
||||
}
|
||||
|
||||
void PredictClassifierModelRequest::setBody(const std::string &body) {
|
||||
body_ = body;
|
||||
setBodyParameter(std::string("body"), body);
|
||||
}
|
||||
|
||||
std::string PredictClassifierModelRequest::getContent() const {
|
||||
return content_;
|
||||
}
|
||||
|
||||
void PredictClassifierModelRequest::setContent(const std::string &content) {
|
||||
content_ = content;
|
||||
setParameter(std::string("Content"), content);
|
||||
}
|
||||
|
||||
long PredictClassifierModelRequest::getClassifierId() const {
|
||||
return classifierId_;
|
||||
}
|
||||
|
||||
void PredictClassifierModelRequest::setClassifierId(long classifierId) {
|
||||
classifierId_ = classifierId;
|
||||
setParameter(std::string("ClassifierId"), std::to_string(classifierId));
|
||||
}
|
||||
|
||||
bool PredictClassifierModelRequest::getAutoPrediction() const {
|
||||
return autoPrediction_;
|
||||
}
|
||||
|
||||
void PredictClassifierModelRequest::setAutoPrediction(bool autoPrediction) {
|
||||
autoPrediction_ = autoPrediction;
|
||||
setParameter(std::string("AutoPrediction"), autoPrediction ? "true" : "false");
|
||||
}
|
||||
|
||||
65
documentautoml/src/model/PredictClassifierModelResult.cc
Normal file
65
documentautoml/src/model/PredictClassifierModelResult.cc
Normal file
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* 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/documentautoml/model/PredictClassifierModelResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::DocumentAutoml;
|
||||
using namespace AlibabaCloud::DocumentAutoml::Model;
|
||||
|
||||
PredictClassifierModelResult::PredictClassifierModelResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
PredictClassifierModelResult::PredictClassifierModelResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
PredictClassifierModelResult::~PredictClassifierModelResult()
|
||||
{}
|
||||
|
||||
void PredictClassifierModelResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["Code"].isNull())
|
||||
code_ = std::stoi(value["Code"].asString());
|
||||
if(!value["Data"].isNull())
|
||||
data_ = value["Data"].asString();
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string PredictClassifierModelResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
std::string PredictClassifierModelResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
int PredictClassifierModelResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
81
documentautoml/src/model/PredictModelRequest.cc
Normal file
81
documentautoml/src/model/PredictModelRequest.cc
Normal file
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
* 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/documentautoml/model/PredictModelRequest.h>
|
||||
|
||||
using AlibabaCloud::DocumentAutoml::Model::PredictModelRequest;
|
||||
|
||||
PredictModelRequest::PredictModelRequest()
|
||||
: RpcServiceRequest("documentautoml", "2022-12-29", "PredictModel") {
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
PredictModelRequest::~PredictModelRequest() {}
|
||||
|
||||
std::string PredictModelRequest::getBody() const {
|
||||
return body_;
|
||||
}
|
||||
|
||||
void PredictModelRequest::setBody(const std::string &body) {
|
||||
body_ = body;
|
||||
setBodyParameter(std::string("body"), body);
|
||||
}
|
||||
|
||||
std::string PredictModelRequest::getContent() const {
|
||||
return content_;
|
||||
}
|
||||
|
||||
void PredictModelRequest::setContent(const std::string &content) {
|
||||
content_ = content;
|
||||
setParameter(std::string("Content"), content);
|
||||
}
|
||||
|
||||
bool PredictModelRequest::getBinaryToText() const {
|
||||
return binaryToText_;
|
||||
}
|
||||
|
||||
void PredictModelRequest::setBinaryToText(bool binaryToText) {
|
||||
binaryToText_ = binaryToText;
|
||||
setParameter(std::string("BinaryToText"), binaryToText ? "true" : "false");
|
||||
}
|
||||
|
||||
std::string PredictModelRequest::getProduct() const {
|
||||
return product_;
|
||||
}
|
||||
|
||||
void PredictModelRequest::setProduct(const std::string &product) {
|
||||
product_ = product;
|
||||
setParameter(std::string("Product"), product);
|
||||
}
|
||||
|
||||
long PredictModelRequest::getModelId() const {
|
||||
return modelId_;
|
||||
}
|
||||
|
||||
void PredictModelRequest::setModelId(long modelId) {
|
||||
modelId_ = modelId;
|
||||
setParameter(std::string("ModelId"), std::to_string(modelId));
|
||||
}
|
||||
|
||||
std::string PredictModelRequest::getModelVersion() const {
|
||||
return modelVersion_;
|
||||
}
|
||||
|
||||
void PredictModelRequest::setModelVersion(const std::string &modelVersion) {
|
||||
modelVersion_ = modelVersion;
|
||||
setParameter(std::string("ModelVersion"), modelVersion);
|
||||
}
|
||||
|
||||
65
documentautoml/src/model/PredictModelResult.cc
Normal file
65
documentautoml/src/model/PredictModelResult.cc
Normal file
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* 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/documentautoml/model/PredictModelResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::DocumentAutoml;
|
||||
using namespace AlibabaCloud::DocumentAutoml::Model;
|
||||
|
||||
PredictModelResult::PredictModelResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
PredictModelResult::PredictModelResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
PredictModelResult::~PredictModelResult()
|
||||
{}
|
||||
|
||||
void PredictModelResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["Code"].isNull())
|
||||
code_ = std::stoi(value["Code"].asString());
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
if(!value["Data"].isNull())
|
||||
data_ = value["Data"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string PredictModelResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
std::string PredictModelResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
int PredictModelResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
72
documentautoml/src/model/PredictTemplateModelRequest.cc
Normal file
72
documentautoml/src/model/PredictTemplateModelRequest.cc
Normal file
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
* 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/documentautoml/model/PredictTemplateModelRequest.h>
|
||||
|
||||
using AlibabaCloud::DocumentAutoml::Model::PredictTemplateModelRequest;
|
||||
|
||||
PredictTemplateModelRequest::PredictTemplateModelRequest()
|
||||
: RpcServiceRequest("documentautoml", "2022-12-29", "PredictTemplateModel") {
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
PredictTemplateModelRequest::~PredictTemplateModelRequest() {}
|
||||
|
||||
std::string PredictTemplateModelRequest::getBody() const {
|
||||
return body_;
|
||||
}
|
||||
|
||||
void PredictTemplateModelRequest::setBody(const std::string &body) {
|
||||
body_ = body;
|
||||
setBodyParameter(std::string("body"), body);
|
||||
}
|
||||
|
||||
std::string PredictTemplateModelRequest::getContent() const {
|
||||
return content_;
|
||||
}
|
||||
|
||||
void PredictTemplateModelRequest::setContent(const std::string &content) {
|
||||
content_ = content;
|
||||
setParameter(std::string("Content"), content);
|
||||
}
|
||||
|
||||
bool PredictTemplateModelRequest::getBinaryToText() const {
|
||||
return binaryToText_;
|
||||
}
|
||||
|
||||
void PredictTemplateModelRequest::setBinaryToText(bool binaryToText) {
|
||||
binaryToText_ = binaryToText;
|
||||
setParameter(std::string("BinaryToText"), binaryToText ? "true" : "false");
|
||||
}
|
||||
|
||||
long PredictTemplateModelRequest::getTaskId() const {
|
||||
return taskId_;
|
||||
}
|
||||
|
||||
void PredictTemplateModelRequest::setTaskId(long taskId) {
|
||||
taskId_ = taskId;
|
||||
setParameter(std::string("TaskId"), std::to_string(taskId));
|
||||
}
|
||||
|
||||
std::string PredictTemplateModelRequest::getProduct() const {
|
||||
return product_;
|
||||
}
|
||||
|
||||
void PredictTemplateModelRequest::setProduct(const std::string &product) {
|
||||
product_ = product;
|
||||
setParameter(std::string("Product"), product);
|
||||
}
|
||||
|
||||
65
documentautoml/src/model/PredictTemplateModelResult.cc
Normal file
65
documentautoml/src/model/PredictTemplateModelResult.cc
Normal file
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* 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/documentautoml/model/PredictTemplateModelResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::DocumentAutoml;
|
||||
using namespace AlibabaCloud::DocumentAutoml::Model;
|
||||
|
||||
PredictTemplateModelResult::PredictTemplateModelResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
PredictTemplateModelResult::PredictTemplateModelResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
PredictTemplateModelResult::~PredictTemplateModelResult()
|
||||
{}
|
||||
|
||||
void PredictTemplateModelResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["Data"].isNull())
|
||||
data_ = value["Data"].asString();
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
if(!value["Code"].isNull())
|
||||
code_ = value["Code"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string PredictTemplateModelResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
std::string PredictTemplateModelResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
std::string PredictTemplateModelResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user