Release first version.

This commit is contained in:
sdk-team
2019-10-21 11:23:43 +08:00
parent e3c9867b49
commit 63f8b47b8d
42 changed files with 2818 additions and 1 deletions

377
iqa/src/IqaClient.cc Normal file
View File

@@ -0,0 +1,377 @@
/*
* 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/iqa/IqaClient.h>
#include <alibabacloud/core/SimpleCredentialsProvider.h>
using namespace AlibabaCloud;
using namespace AlibabaCloud::Location;
using namespace AlibabaCloud::Iqa;
using namespace AlibabaCloud::Iqa::Model;
namespace
{
const std::string SERVICE_NAME = "iqa";
}
IqaClient::IqaClient(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, "iqa");
}
IqaClient::IqaClient(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, "iqa");
}
IqaClient::IqaClient(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, "iqa");
}
IqaClient::~IqaClient()
{}
IqaClient::CreateProjectOutcome IqaClient::createProject(const CreateProjectRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return CreateProjectOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return CreateProjectOutcome(CreateProjectResult(outcome.result()));
else
return CreateProjectOutcome(outcome.error());
}
void IqaClient::createProjectAsync(const CreateProjectRequest& request, const CreateProjectAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, createProject(request), context);
};
asyncExecute(new Runnable(fn));
}
IqaClient::CreateProjectOutcomeCallable IqaClient::createProjectCallable(const CreateProjectRequest &request) const
{
auto task = std::make_shared<std::packaged_task<CreateProjectOutcome()>>(
[this, request]()
{
return this->createProject(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
IqaClient::DeleteProjectOutcome IqaClient::deleteProject(const DeleteProjectRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return DeleteProjectOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return DeleteProjectOutcome(DeleteProjectResult(outcome.result()));
else
return DeleteProjectOutcome(outcome.error());
}
void IqaClient::deleteProjectAsync(const DeleteProjectRequest& request, const DeleteProjectAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, deleteProject(request), context);
};
asyncExecute(new Runnable(fn));
}
IqaClient::DeleteProjectOutcomeCallable IqaClient::deleteProjectCallable(const DeleteProjectRequest &request) const
{
auto task = std::make_shared<std::packaged_task<DeleteProjectOutcome()>>(
[this, request]()
{
return this->deleteProject(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
IqaClient::DeployServiceOutcome IqaClient::deployService(const DeployServiceRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return DeployServiceOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return DeployServiceOutcome(DeployServiceResult(outcome.result()));
else
return DeployServiceOutcome(outcome.error());
}
void IqaClient::deployServiceAsync(const DeployServiceRequest& request, const DeployServiceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, deployService(request), context);
};
asyncExecute(new Runnable(fn));
}
IqaClient::DeployServiceOutcomeCallable IqaClient::deployServiceCallable(const DeployServiceRequest &request) const
{
auto task = std::make_shared<std::packaged_task<DeployServiceOutcome()>>(
[this, request]()
{
return this->deployService(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
IqaClient::DescribeProjectOutcome IqaClient::describeProject(const DescribeProjectRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return DescribeProjectOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return DescribeProjectOutcome(DescribeProjectResult(outcome.result()));
else
return DescribeProjectOutcome(outcome.error());
}
void IqaClient::describeProjectAsync(const DescribeProjectRequest& request, const DescribeProjectAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, describeProject(request), context);
};
asyncExecute(new Runnable(fn));
}
IqaClient::DescribeProjectOutcomeCallable IqaClient::describeProjectCallable(const DescribeProjectRequest &request) const
{
auto task = std::make_shared<std::packaged_task<DescribeProjectOutcome()>>(
[this, request]()
{
return this->describeProject(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
IqaClient::GetPredictResultOutcome IqaClient::getPredictResult(const GetPredictResultRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return GetPredictResultOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return GetPredictResultOutcome(GetPredictResultResult(outcome.result()));
else
return GetPredictResultOutcome(outcome.error());
}
void IqaClient::getPredictResultAsync(const GetPredictResultRequest& request, const GetPredictResultAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, getPredictResult(request), context);
};
asyncExecute(new Runnable(fn));
}
IqaClient::GetPredictResultOutcomeCallable IqaClient::getPredictResultCallable(const GetPredictResultRequest &request) const
{
auto task = std::make_shared<std::packaged_task<GetPredictResultOutcome()>>(
[this, request]()
{
return this->getPredictResult(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
IqaClient::ListProjectsOutcome IqaClient::listProjects(const ListProjectsRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return ListProjectsOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return ListProjectsOutcome(ListProjectsResult(outcome.result()));
else
return ListProjectsOutcome(outcome.error());
}
void IqaClient::listProjectsAsync(const ListProjectsRequest& request, const ListProjectsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, listProjects(request), context);
};
asyncExecute(new Runnable(fn));
}
IqaClient::ListProjectsOutcomeCallable IqaClient::listProjectsCallable(const ListProjectsRequest &request) const
{
auto task = std::make_shared<std::packaged_task<ListProjectsOutcome()>>(
[this, request]()
{
return this->listProjects(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
IqaClient::ModifiyProjectOutcome IqaClient::modifiyProject(const ModifiyProjectRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return ModifiyProjectOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return ModifiyProjectOutcome(ModifiyProjectResult(outcome.result()));
else
return ModifiyProjectOutcome(outcome.error());
}
void IqaClient::modifiyProjectAsync(const ModifiyProjectRequest& request, const ModifiyProjectAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, modifiyProject(request), context);
};
asyncExecute(new Runnable(fn));
}
IqaClient::ModifiyProjectOutcomeCallable IqaClient::modifiyProjectCallable(const ModifiyProjectRequest &request) const
{
auto task = std::make_shared<std::packaged_task<ModifiyProjectOutcome()>>(
[this, request]()
{
return this->modifiyProject(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
IqaClient::UploadDictionaryOutcome IqaClient::uploadDictionary(const UploadDictionaryRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return UploadDictionaryOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return UploadDictionaryOutcome(UploadDictionaryResult(outcome.result()));
else
return UploadDictionaryOutcome(outcome.error());
}
void IqaClient::uploadDictionaryAsync(const UploadDictionaryRequest& request, const UploadDictionaryAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, uploadDictionary(request), context);
};
asyncExecute(new Runnable(fn));
}
IqaClient::UploadDictionaryOutcomeCallable IqaClient::uploadDictionaryCallable(const UploadDictionaryRequest &request) const
{
auto task = std::make_shared<std::packaged_task<UploadDictionaryOutcome()>>(
[this, request]()
{
return this->uploadDictionary(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
IqaClient::UploadDocumentOutcome IqaClient::uploadDocument(const UploadDocumentRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return UploadDocumentOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return UploadDocumentOutcome(UploadDocumentResult(outcome.result()));
else
return UploadDocumentOutcome(outcome.error());
}
void IqaClient::uploadDocumentAsync(const UploadDocumentRequest& request, const UploadDocumentAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, uploadDocument(request), context);
};
asyncExecute(new Runnable(fn));
}
IqaClient::UploadDocumentOutcomeCallable IqaClient::uploadDocumentCallable(const UploadDocumentRequest &request) const
{
auto task = std::make_shared<std::packaged_task<UploadDocumentOutcome()>>(
[this, request]()
{
return this->uploadDocument(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}

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/iqa/model/CreateProjectRequest.h>
using AlibabaCloud::Iqa::Model::CreateProjectRequest;
CreateProjectRequest::CreateProjectRequest() :
RpcServiceRequest("iqa", "2019-08-13", "CreateProject")
{}
CreateProjectRequest::~CreateProjectRequest()
{}
std::string CreateProjectRequest::getProjectName()const
{
return projectName_;
}
void CreateProjectRequest::setProjectName(const std::string& projectName)
{
projectName_ = projectName;
setCoreParameter("ProjectName", projectName);
}
std::string CreateProjectRequest::getModelId()const
{
return modelId_;
}
void CreateProjectRequest::setModelId(const std::string& modelId)
{
modelId_ = modelId;
setCoreParameter("ModelId", modelId);
}
std::string CreateProjectRequest::getProjectType()const
{
return projectType_;
}
void CreateProjectRequest::setProjectType(const std::string& projectType)
{
projectType_ = projectType;
setCoreParameter("ProjectType", projectType);
}

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/iqa/model/CreateProjectResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Iqa;
using namespace AlibabaCloud::Iqa::Model;
CreateProjectResult::CreateProjectResult() :
ServiceResult()
{}
CreateProjectResult::CreateProjectResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
CreateProjectResult::~CreateProjectResult()
{}
void CreateProjectResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
if(!value["ProjectId"].isNull())
projectId_ = value["ProjectId"].asString();
}
std::string CreateProjectResult::getProjectId()const
{
return projectId_;
}

View File

@@ -0,0 +1,38 @@
/*
* 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/iqa/model/DeleteProjectRequest.h>
using AlibabaCloud::Iqa::Model::DeleteProjectRequest;
DeleteProjectRequest::DeleteProjectRequest() :
RpcServiceRequest("iqa", "2019-08-13", "DeleteProject")
{}
DeleteProjectRequest::~DeleteProjectRequest()
{}
std::string DeleteProjectRequest::getProjectId()const
{
return projectId_;
}
void DeleteProjectRequest::setProjectId(const std::string& projectId)
{
projectId_ = projectId;
setCoreParameter("ProjectId", projectId);
}

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/iqa/model/DeleteProjectResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Iqa;
using namespace AlibabaCloud::Iqa::Model;
DeleteProjectResult::DeleteProjectResult() :
ServiceResult()
{}
DeleteProjectResult::DeleteProjectResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
DeleteProjectResult::~DeleteProjectResult()
{}
void DeleteProjectResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
}

View File

@@ -0,0 +1,38 @@
/*
* 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/iqa/model/DeployServiceRequest.h>
using AlibabaCloud::Iqa::Model::DeployServiceRequest;
DeployServiceRequest::DeployServiceRequest() :
RpcServiceRequest("iqa", "2019-08-13", "DeployService")
{}
DeployServiceRequest::~DeployServiceRequest()
{}
std::string DeployServiceRequest::getProjectId()const
{
return projectId_;
}
void DeployServiceRequest::setProjectId(const std::string& projectId)
{
projectId_ = projectId;
setCoreParameter("ProjectId", projectId);
}

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/iqa/model/DeployServiceResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Iqa;
using namespace AlibabaCloud::Iqa::Model;
DeployServiceResult::DeployServiceResult() :
ServiceResult()
{}
DeployServiceResult::DeployServiceResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
DeployServiceResult::~DeployServiceResult()
{}
void DeployServiceResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
}

View File

@@ -0,0 +1,38 @@
/*
* 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/iqa/model/DescribeProjectRequest.h>
using AlibabaCloud::Iqa::Model::DescribeProjectRequest;
DescribeProjectRequest::DescribeProjectRequest() :
RpcServiceRequest("iqa", "2019-08-13", "DescribeProject")
{}
DescribeProjectRequest::~DescribeProjectRequest()
{}
std::string DescribeProjectRequest::getProjectId()const
{
return projectId_;
}
void DescribeProjectRequest::setProjectId(const std::string& projectId)
{
projectId_ = projectId;
setCoreParameter("ProjectId", projectId);
}

View File

@@ -0,0 +1,128 @@
/*
* 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/iqa/model/DescribeProjectResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Iqa;
using namespace AlibabaCloud::Iqa::Model;
DescribeProjectResult::DescribeProjectResult() :
ServiceResult()
{}
DescribeProjectResult::DescribeProjectResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
DescribeProjectResult::~DescribeProjectResult()
{}
void DescribeProjectResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
if(!value["ProjectType"].isNull())
projectType_ = value["ProjectType"].asString();
if(!value["ProjectId"].isNull())
projectId_ = value["ProjectId"].asString();
if(!value["ProjectName"].isNull())
projectName_ = value["ProjectName"].asString();
if(!value["CreateTime"].isNull())
createTime_ = std::stol(value["CreateTime"].asString());
if(!value["DeployTime"].isNull())
deployTime_ = std::stol(value["DeployTime"].asString());
if(!value["ModelId"].isNull())
modelId_ = value["ModelId"].asString();
if(!value["ModelName"].isNull())
modelName_ = value["ModelName"].asString();
if(!value["QuestionCount"].isNull())
questionCount_ = std::stoi(value["QuestionCount"].asString());
if(!value["DataStatus"].isNull())
dataStatus_ = value["DataStatus"].asString();
if(!value["TestServiceStatus"].isNull())
testServiceStatus_ = value["TestServiceStatus"].asString();
if(!value["OnlineServiceStatus"].isNull())
onlineServiceStatus_ = value["OnlineServiceStatus"].asString();
if(!value["DeployAvailable"].isNull())
deployAvailable_ = value["DeployAvailable"].asString();
}
int DescribeProjectResult::getQuestionCount()const
{
return questionCount_;
}
std::string DescribeProjectResult::getModelName()const
{
return modelName_;
}
std::string DescribeProjectResult::getDeployAvailable()const
{
return deployAvailable_;
}
std::string DescribeProjectResult::getProjectName()const
{
return projectName_;
}
long DescribeProjectResult::getDeployTime()const
{
return deployTime_;
}
std::string DescribeProjectResult::getProjectType()const
{
return projectType_;
}
long DescribeProjectResult::getCreateTime()const
{
return createTime_;
}
std::string DescribeProjectResult::getProjectId()const
{
return projectId_;
}
std::string DescribeProjectResult::getDataStatus()const
{
return dataStatus_;
}
std::string DescribeProjectResult::getModelId()const
{
return modelId_;
}
std::string DescribeProjectResult::getOnlineServiceStatus()const
{
return onlineServiceStatus_;
}
std::string DescribeProjectResult::getTestServiceStatus()const
{
return testServiceStatus_;
}

View File

@@ -0,0 +1,71 @@
/*
* 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/iqa/model/GetPredictResultRequest.h>
using AlibabaCloud::Iqa::Model::GetPredictResultRequest;
GetPredictResultRequest::GetPredictResultRequest() :
RpcServiceRequest("iqa", "2019-08-13", "GetPredictResult")
{}
GetPredictResultRequest::~GetPredictResultRequest()
{}
int GetPredictResultRequest::getTopK()const
{
return topK_;
}
void GetPredictResultRequest::setTopK(int topK)
{
topK_ = topK;
setCoreParameter("TopK", std::to_string(topK));
}
std::string GetPredictResultRequest::getTraceTag()const
{
return traceTag_;
}
void GetPredictResultRequest::setTraceTag(const std::string& traceTag)
{
traceTag_ = traceTag;
setCoreParameter("TraceTag", traceTag);
}
std::string GetPredictResultRequest::getQuestion()const
{
return question_;
}
void GetPredictResultRequest::setQuestion(const std::string& question)
{
question_ = question;
setCoreParameter("Question", question);
}
std::string GetPredictResultRequest::getProjectId()const
{
return projectId_;
}
void GetPredictResultRequest::setProjectId(const std::string& projectId)
{
projectId_ = projectId;
setCoreParameter("ProjectId", projectId);
}

View File

@@ -0,0 +1,107 @@
/*
* 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/iqa/model/GetPredictResultResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Iqa;
using namespace AlibabaCloud::Iqa::Model;
GetPredictResultResult::GetPredictResultResult() :
ServiceResult()
{}
GetPredictResultResult::GetPredictResultResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
GetPredictResultResult::~GetPredictResultResult()
{}
void GetPredictResultResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto allPredictResultsNode = value["PredictResults"]["PredictResult"];
for (auto valuePredictResultsPredictResult : allPredictResultsNode)
{
PredictResult predictResultsObject;
if(!valuePredictResultsPredictResult["Rank"].isNull())
predictResultsObject.rank = std::stoi(valuePredictResultsPredictResult["Rank"].asString());
if(!valuePredictResultsPredictResult["QuestionId"].isNull())
predictResultsObject.questionId = valuePredictResultsPredictResult["QuestionId"].asString();
if(!valuePredictResultsPredictResult["Question"].isNull())
predictResultsObject.question = valuePredictResultsPredictResult["Question"].asString();
if(!valuePredictResultsPredictResult["Score"].isNull())
predictResultsObject.score = std::stof(valuePredictResultsPredictResult["Score"].asString());
if(!valuePredictResultsPredictResult["Answer"].isNull())
predictResultsObject.answer = valuePredictResultsPredictResult["Answer"].asString();
predictResults_.push_back(predictResultsObject);
}
if(!value["ProjectId"].isNull())
projectId_ = value["ProjectId"].asString();
if(!value["Question"].isNull())
question_ = value["Question"].asString();
if(!value["TopK"].isNull())
topK_ = std::stoi(value["TopK"].asString());
if(!value["TraceTag"].isNull())
traceTag_ = value["TraceTag"].asString();
if(!value["CostTime"].isNull())
costTime_ = std::stol(value["CostTime"].asString());
if(!value["Trace"].isNull())
trace_ = value["Trace"].asString();
}
long GetPredictResultResult::getCostTime()const
{
return costTime_;
}
std::string GetPredictResultResult::getTrace()const
{
return trace_;
}
int GetPredictResultResult::getTopK()const
{
return topK_;
}
std::string GetPredictResultResult::getTraceTag()const
{
return traceTag_;
}
std::string GetPredictResultResult::getProjectId()const
{
return projectId_;
}
std::string GetPredictResultResult::getQuestion()const
{
return question_;
}
std::vector<GetPredictResultResult::PredictResult> GetPredictResultResult::getPredictResults()const
{
return predictResults_;
}

View File

@@ -0,0 +1,71 @@
/*
* 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/iqa/model/ListProjectsRequest.h>
using AlibabaCloud::Iqa::Model::ListProjectsRequest;
ListProjectsRequest::ListProjectsRequest() :
RpcServiceRequest("iqa", "2019-08-13", "ListProjects")
{}
ListProjectsRequest::~ListProjectsRequest()
{}
std::string ListProjectsRequest::getFilterParam()const
{
return filterParam_;
}
void ListProjectsRequest::setFilterParam(const std::string& filterParam)
{
filterParam_ = filterParam;
setCoreParameter("FilterParam", filterParam);
}
int ListProjectsRequest::getPageNumber()const
{
return pageNumber_;
}
void ListProjectsRequest::setPageNumber(int pageNumber)
{
pageNumber_ = pageNumber;
setCoreParameter("PageNumber", std::to_string(pageNumber));
}
int ListProjectsRequest::getPageSize()const
{
return pageSize_;
}
void ListProjectsRequest::setPageSize(int pageSize)
{
pageSize_ = pageSize;
setCoreParameter("PageSize", std::to_string(pageSize));
}
std::string ListProjectsRequest::getProjectType()const
{
return projectType_;
}
void ListProjectsRequest::setProjectType(const std::string& projectType)
{
projectType_ = projectType;
setCoreParameter("ProjectType", projectType);
}

View File

@@ -0,0 +1,100 @@
/*
* 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/iqa/model/ListProjectsResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Iqa;
using namespace AlibabaCloud::Iqa::Model;
ListProjectsResult::ListProjectsResult() :
ServiceResult()
{}
ListProjectsResult::ListProjectsResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
ListProjectsResult::~ListProjectsResult()
{}
void ListProjectsResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto allProjectsNode = value["Projects"]["Project"];
for (auto valueProjectsProject : allProjectsNode)
{
Project projectsObject;
if(!valueProjectsProject["ProjectType"].isNull())
projectsObject.projectType = valueProjectsProject["ProjectType"].asString();
if(!valueProjectsProject["ProjectId"].isNull())
projectsObject.projectId = valueProjectsProject["ProjectId"].asString();
if(!valueProjectsProject["ProjectName"].isNull())
projectsObject.projectName = valueProjectsProject["ProjectName"].asString();
if(!valueProjectsProject["CreateTime"].isNull())
projectsObject.createTime = std::stol(valueProjectsProject["CreateTime"].asString());
if(!valueProjectsProject["DeployTime"].isNull())
projectsObject.deployTime = std::stol(valueProjectsProject["DeployTime"].asString());
if(!valueProjectsProject["ModelId"].isNull())
projectsObject.modelId = valueProjectsProject["ModelId"].asString();
if(!valueProjectsProject["QuestionCount"].isNull())
projectsObject.questionCount = std::stoi(valueProjectsProject["QuestionCount"].asString());
if(!valueProjectsProject["DataStatus"].isNull())
projectsObject.dataStatus = valueProjectsProject["DataStatus"].asString();
if(!valueProjectsProject["TestServiceStatus"].isNull())
projectsObject.testServiceStatus = valueProjectsProject["TestServiceStatus"].asString();
if(!valueProjectsProject["OnlineServiceStatus"].isNull())
projectsObject.onlineServiceStatus = valueProjectsProject["OnlineServiceStatus"].asString();
if(!valueProjectsProject["DeployAvailable"].isNull())
projectsObject.deployAvailable = valueProjectsProject["DeployAvailable"].asString();
if(!valueProjectsProject["ModelName"].isNull())
projectsObject.modelName = valueProjectsProject["ModelName"].asString();
projects_.push_back(projectsObject);
}
if(!value["TotalCount"].isNull())
totalCount_ = std::stoi(value["TotalCount"].asString());
if(!value["PageNumber"].isNull())
pageNumber_ = std::stoi(value["PageNumber"].asString());
if(!value["PageSize"].isNull())
pageSize_ = std::stoi(value["PageSize"].asString());
}
int ListProjectsResult::getTotalCount()const
{
return totalCount_;
}
int ListProjectsResult::getPageSize()const
{
return pageSize_;
}
int ListProjectsResult::getPageNumber()const
{
return pageNumber_;
}
std::vector<ListProjectsResult::Project> ListProjectsResult::getProjects()const
{
return projects_;
}

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/iqa/model/ModifiyProjectRequest.h>
using AlibabaCloud::Iqa::Model::ModifiyProjectRequest;
ModifiyProjectRequest::ModifiyProjectRequest() :
RpcServiceRequest("iqa", "2019-08-13", "ModifiyProject")
{}
ModifiyProjectRequest::~ModifiyProjectRequest()
{}
std::string ModifiyProjectRequest::getProjectName()const
{
return projectName_;
}
void ModifiyProjectRequest::setProjectName(const std::string& projectName)
{
projectName_ = projectName;
setCoreParameter("ProjectName", projectName);
}
std::string ModifiyProjectRequest::getModelId()const
{
return modelId_;
}
void ModifiyProjectRequest::setModelId(const std::string& modelId)
{
modelId_ = modelId;
setCoreParameter("ModelId", modelId);
}
std::string ModifiyProjectRequest::getProjectId()const
{
return projectId_;
}
void ModifiyProjectRequest::setProjectId(const std::string& projectId)
{
projectId_ = projectId;
setCoreParameter("ProjectId", projectId);
}

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/iqa/model/ModifiyProjectResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Iqa;
using namespace AlibabaCloud::Iqa::Model;
ModifiyProjectResult::ModifiyProjectResult() :
ServiceResult()
{}
ModifiyProjectResult::ModifiyProjectResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
ModifiyProjectResult::~ModifiyProjectResult()
{}
void ModifiyProjectResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
if(!value["ProjectId"].isNull())
projectId_ = value["ProjectId"].asString();
}
std::string ModifiyProjectResult::getProjectId()const
{
return projectId_;
}

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/iqa/model/UploadDictionaryRequest.h>
using AlibabaCloud::Iqa::Model::UploadDictionaryRequest;
UploadDictionaryRequest::UploadDictionaryRequest() :
RpcServiceRequest("iqa", "2019-08-13", "UploadDictionary")
{}
UploadDictionaryRequest::~UploadDictionaryRequest()
{}
std::string UploadDictionaryRequest::getDictionaryFileUrl()const
{
return dictionaryFileUrl_;
}
void UploadDictionaryRequest::setDictionaryFileUrl(const std::string& dictionaryFileUrl)
{
dictionaryFileUrl_ = dictionaryFileUrl;
setCoreParameter("DictionaryFileUrl", dictionaryFileUrl);
}
std::string UploadDictionaryRequest::getProjectId()const
{
return projectId_;
}
void UploadDictionaryRequest::setProjectId(const std::string& projectId)
{
projectId_ = projectId;
setCoreParameter("ProjectId", projectId);
}
std::string UploadDictionaryRequest::getDictionaryData()const
{
return dictionaryData_;
}
void UploadDictionaryRequest::setDictionaryData(const std::string& dictionaryData)
{
dictionaryData_ = dictionaryData;
setCoreParameter("DictionaryData", dictionaryData);
}

View 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/iqa/model/UploadDictionaryResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Iqa;
using namespace AlibabaCloud::Iqa::Model;
UploadDictionaryResult::UploadDictionaryResult() :
ServiceResult()
{}
UploadDictionaryResult::UploadDictionaryResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
UploadDictionaryResult::~UploadDictionaryResult()
{}
void UploadDictionaryResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
if(!value["ProjectId"].isNull())
projectId_ = value["ProjectId"].asString();
if(!value["TotalCount"].isNull())
totalCount_ = std::stoi(value["TotalCount"].asString());
if(!value["FileDataCount"].isNull())
fileDataCount_ = std::stoi(value["FileDataCount"].asString());
if(!value["JsonDataCount"].isNull())
jsonDataCount_ = std::stoi(value["JsonDataCount"].asString());
}
int UploadDictionaryResult::getTotalCount()const
{
return totalCount_;
}
std::string UploadDictionaryResult::getProjectId()const
{
return projectId_;
}
int UploadDictionaryResult::getFileDataCount()const
{
return fileDataCount_;
}
int UploadDictionaryResult::getJsonDataCount()const
{
return jsonDataCount_;
}

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/iqa/model/UploadDocumentRequest.h>
using AlibabaCloud::Iqa::Model::UploadDocumentRequest;
UploadDocumentRequest::UploadDocumentRequest() :
RpcServiceRequest("iqa", "2019-08-13", "UploadDocument")
{}
UploadDocumentRequest::~UploadDocumentRequest()
{}
std::string UploadDocumentRequest::getDocumentData()const
{
return documentData_;
}
void UploadDocumentRequest::setDocumentData(const std::string& documentData)
{
documentData_ = documentData;
setCoreParameter("DocumentData", documentData);
}
std::string UploadDocumentRequest::getDocumentFileUrl()const
{
return documentFileUrl_;
}
void UploadDocumentRequest::setDocumentFileUrl(const std::string& documentFileUrl)
{
documentFileUrl_ = documentFileUrl;
setCoreParameter("DocumentFileUrl", documentFileUrl);
}
std::string UploadDocumentRequest::getProjectId()const
{
return projectId_;
}
void UploadDocumentRequest::setProjectId(const std::string& projectId)
{
projectId_ = projectId;
setCoreParameter("ProjectId", projectId);
}

View 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/iqa/model/UploadDocumentResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Iqa;
using namespace AlibabaCloud::Iqa::Model;
UploadDocumentResult::UploadDocumentResult() :
ServiceResult()
{}
UploadDocumentResult::UploadDocumentResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
UploadDocumentResult::~UploadDocumentResult()
{}
void UploadDocumentResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
if(!value["ProjectId"].isNull())
projectId_ = value["ProjectId"].asString();
if(!value["TotalCount"].isNull())
totalCount_ = std::stoi(value["TotalCount"].asString());
if(!value["FileDataCount"].isNull())
fileDataCount_ = std::stoi(value["FileDataCount"].asString());
if(!value["JsonDataCount"].isNull())
jsonDataCount_ = std::stoi(value["JsonDataCount"].asString());
}
int UploadDocumentResult::getTotalCount()const
{
return totalCount_;
}
std::string UploadDocumentResult::getProjectId()const
{
return projectId_;
}
int UploadDocumentResult::getFileDataCount()const
{
return fileDataCount_;
}
int UploadDocumentResult::getJsonDataCount()const
{
return jsonDataCount_;
}