DocumentInit.
This commit is contained in:
102
documentautoml/CMakeLists.txt
Normal file
102
documentautoml/CMakeLists.txt
Normal file
@@ -0,0 +1,102 @@
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
set(public_header_dir ${CMAKE_CURRENT_SOURCE_DIR}/../include)
|
||||
|
||||
set(documentautoml_public_header
|
||||
include/alibabacloud/documentautoml/DocumentAutomlClient.h
|
||||
include/alibabacloud/documentautoml/DocumentAutomlExport.h )
|
||||
|
||||
set(documentautoml_public_header_model
|
||||
include/alibabacloud/documentautoml/model/CreateModelAsyncPredictRequest.h
|
||||
include/alibabacloud/documentautoml/model/CreateModelAsyncPredictResult.h
|
||||
include/alibabacloud/documentautoml/model/GetModelAsyncPredictRequest.h
|
||||
include/alibabacloud/documentautoml/model/GetModelAsyncPredictResult.h
|
||||
include/alibabacloud/documentautoml/model/PredictClassifierModelRequest.h
|
||||
include/alibabacloud/documentautoml/model/PredictClassifierModelResult.h
|
||||
include/alibabacloud/documentautoml/model/PredictModelRequest.h
|
||||
include/alibabacloud/documentautoml/model/PredictModelResult.h
|
||||
include/alibabacloud/documentautoml/model/PredictTemplateModelRequest.h
|
||||
include/alibabacloud/documentautoml/model/PredictTemplateModelResult.h )
|
||||
|
||||
set(documentautoml_src
|
||||
src/DocumentAutomlClient.cc
|
||||
src/model/CreateModelAsyncPredictRequest.cc
|
||||
src/model/CreateModelAsyncPredictResult.cc
|
||||
src/model/GetModelAsyncPredictRequest.cc
|
||||
src/model/GetModelAsyncPredictResult.cc
|
||||
src/model/PredictClassifierModelRequest.cc
|
||||
src/model/PredictClassifierModelResult.cc
|
||||
src/model/PredictModelRequest.cc
|
||||
src/model/PredictModelResult.cc
|
||||
src/model/PredictTemplateModelRequest.cc
|
||||
src/model/PredictTemplateModelResult.cc )
|
||||
|
||||
add_library(documentautoml ${LIB_TYPE}
|
||||
${documentautoml_public_header}
|
||||
${documentautoml_public_header_model}
|
||||
${documentautoml_src})
|
||||
|
||||
set_target_properties(documentautoml
|
||||
PROPERTIES
|
||||
LINKER_LANGUAGE CXX
|
||||
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib
|
||||
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib
|
||||
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
|
||||
OUTPUT_NAME ${TARGET_OUTPUT_NAME_PREFIX}documentautoml
|
||||
)
|
||||
|
||||
if(${LIB_TYPE} STREQUAL "SHARED")
|
||||
set_target_properties(documentautoml
|
||||
PROPERTIES
|
||||
DEFINE_SYMBOL ALIBABACLOUD_DOCUMENTAUTOML_LIBRARY)
|
||||
endif()
|
||||
|
||||
target_include_directories(documentautoml
|
||||
PRIVATE include
|
||||
${CMAKE_SOURCE_DIR}/core/include
|
||||
)
|
||||
target_link_libraries(documentautoml
|
||||
core)
|
||||
|
||||
if(CMAKE_HOST_WIN32)
|
||||
ExternalProject_Get_Property(jsoncpp INSTALL_DIR)
|
||||
set(jsoncpp_install_dir ${INSTALL_DIR})
|
||||
add_dependencies(documentautoml
|
||||
jsoncpp)
|
||||
target_include_directories(documentautoml
|
||||
PRIVATE ${jsoncpp_install_dir}/include)
|
||||
target_link_libraries(documentautoml
|
||||
${jsoncpp_install_dir}/lib/jsoncpp.lib)
|
||||
set_target_properties(documentautoml
|
||||
PROPERTIES
|
||||
COMPILE_OPTIONS "/bigobj")
|
||||
else()
|
||||
target_include_directories(documentautoml
|
||||
PRIVATE /usr/include/jsoncpp)
|
||||
target_link_libraries(documentautoml
|
||||
jsoncpp)
|
||||
endif()
|
||||
|
||||
install(FILES ${documentautoml_public_header}
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/documentautoml)
|
||||
install(FILES ${documentautoml_public_header_model}
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/documentautoml/model)
|
||||
install(TARGETS documentautoml
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
)
|
||||
@@ -0,0 +1,86 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_DOCUMENTAUTOML_DOCUMENTAUTOMLCLIENT_H_
|
||||
#define ALIBABACLOUD_DOCUMENTAUTOML_DOCUMENTAUTOMLCLIENT_H_
|
||||
|
||||
#include <future>
|
||||
#include <alibabacloud/core/AsyncCallerContext.h>
|
||||
#include <alibabacloud/core/EndpointProvider.h>
|
||||
#include <alibabacloud/core/RpcServiceClient.h>
|
||||
#include "DocumentAutomlExport.h"
|
||||
#include "model/CreateModelAsyncPredictRequest.h"
|
||||
#include "model/CreateModelAsyncPredictResult.h"
|
||||
#include "model/GetModelAsyncPredictRequest.h"
|
||||
#include "model/GetModelAsyncPredictResult.h"
|
||||
#include "model/PredictClassifierModelRequest.h"
|
||||
#include "model/PredictClassifierModelResult.h"
|
||||
#include "model/PredictModelRequest.h"
|
||||
#include "model/PredictModelResult.h"
|
||||
#include "model/PredictTemplateModelRequest.h"
|
||||
#include "model/PredictTemplateModelResult.h"
|
||||
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace DocumentAutoml
|
||||
{
|
||||
class ALIBABACLOUD_DOCUMENTAUTOML_EXPORT DocumentAutomlClient : public RpcServiceClient
|
||||
{
|
||||
public:
|
||||
typedef Outcome<Error, Model::CreateModelAsyncPredictResult> CreateModelAsyncPredictOutcome;
|
||||
typedef std::future<CreateModelAsyncPredictOutcome> CreateModelAsyncPredictOutcomeCallable;
|
||||
typedef std::function<void(const DocumentAutomlClient*, const Model::CreateModelAsyncPredictRequest&, const CreateModelAsyncPredictOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> CreateModelAsyncPredictAsyncHandler;
|
||||
typedef Outcome<Error, Model::GetModelAsyncPredictResult> GetModelAsyncPredictOutcome;
|
||||
typedef std::future<GetModelAsyncPredictOutcome> GetModelAsyncPredictOutcomeCallable;
|
||||
typedef std::function<void(const DocumentAutomlClient*, const Model::GetModelAsyncPredictRequest&, const GetModelAsyncPredictOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetModelAsyncPredictAsyncHandler;
|
||||
typedef Outcome<Error, Model::PredictClassifierModelResult> PredictClassifierModelOutcome;
|
||||
typedef std::future<PredictClassifierModelOutcome> PredictClassifierModelOutcomeCallable;
|
||||
typedef std::function<void(const DocumentAutomlClient*, const Model::PredictClassifierModelRequest&, const PredictClassifierModelOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> PredictClassifierModelAsyncHandler;
|
||||
typedef Outcome<Error, Model::PredictModelResult> PredictModelOutcome;
|
||||
typedef std::future<PredictModelOutcome> PredictModelOutcomeCallable;
|
||||
typedef std::function<void(const DocumentAutomlClient*, const Model::PredictModelRequest&, const PredictModelOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> PredictModelAsyncHandler;
|
||||
typedef Outcome<Error, Model::PredictTemplateModelResult> PredictTemplateModelOutcome;
|
||||
typedef std::future<PredictTemplateModelOutcome> PredictTemplateModelOutcomeCallable;
|
||||
typedef std::function<void(const DocumentAutomlClient*, const Model::PredictTemplateModelRequest&, const PredictTemplateModelOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> PredictTemplateModelAsyncHandler;
|
||||
|
||||
DocumentAutomlClient(const Credentials &credentials, const ClientConfiguration &configuration);
|
||||
DocumentAutomlClient(const std::shared_ptr<CredentialsProvider> &credentialsProvider, const ClientConfiguration &configuration);
|
||||
DocumentAutomlClient(const std::string &accessKeyId, const std::string &accessKeySecret, const ClientConfiguration &configuration);
|
||||
~DocumentAutomlClient();
|
||||
CreateModelAsyncPredictOutcome createModelAsyncPredict(const Model::CreateModelAsyncPredictRequest &request)const;
|
||||
void createModelAsyncPredictAsync(const Model::CreateModelAsyncPredictRequest& request, const CreateModelAsyncPredictAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
CreateModelAsyncPredictOutcomeCallable createModelAsyncPredictCallable(const Model::CreateModelAsyncPredictRequest& request) const;
|
||||
GetModelAsyncPredictOutcome getModelAsyncPredict(const Model::GetModelAsyncPredictRequest &request)const;
|
||||
void getModelAsyncPredictAsync(const Model::GetModelAsyncPredictRequest& request, const GetModelAsyncPredictAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
GetModelAsyncPredictOutcomeCallable getModelAsyncPredictCallable(const Model::GetModelAsyncPredictRequest& request) const;
|
||||
PredictClassifierModelOutcome predictClassifierModel(const Model::PredictClassifierModelRequest &request)const;
|
||||
void predictClassifierModelAsync(const Model::PredictClassifierModelRequest& request, const PredictClassifierModelAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
PredictClassifierModelOutcomeCallable predictClassifierModelCallable(const Model::PredictClassifierModelRequest& request) const;
|
||||
PredictModelOutcome predictModel(const Model::PredictModelRequest &request)const;
|
||||
void predictModelAsync(const Model::PredictModelRequest& request, const PredictModelAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
PredictModelOutcomeCallable predictModelCallable(const Model::PredictModelRequest& request) const;
|
||||
PredictTemplateModelOutcome predictTemplateModel(const Model::PredictTemplateModelRequest &request)const;
|
||||
void predictTemplateModelAsync(const Model::PredictTemplateModelRequest& request, const PredictTemplateModelAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
PredictTemplateModelOutcomeCallable predictTemplateModelCallable(const Model::PredictTemplateModelRequest& request) const;
|
||||
|
||||
private:
|
||||
std::shared_ptr<EndpointProvider> endpointProvider_;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !ALIBABACLOUD_DOCUMENTAUTOML_DOCUMENTAUTOMLCLIENT_H_
|
||||
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_DOCUMENTAUTOML_DOCUMENTAUTOMLEXPORT_H_
|
||||
#define ALIBABACLOUD_DOCUMENTAUTOML_DOCUMENTAUTOMLEXPORT_H_
|
||||
|
||||
#include <alibabacloud/core/Global.h>
|
||||
|
||||
#if defined(ALIBABACLOUD_SHARED)
|
||||
# if defined(ALIBABACLOUD_DOCUMENTAUTOML_LIBRARY)
|
||||
# define ALIBABACLOUD_DOCUMENTAUTOML_EXPORT ALIBABACLOUD_DECL_EXPORT
|
||||
# else
|
||||
# define ALIBABACLOUD_DOCUMENTAUTOML_EXPORT ALIBABACLOUD_DECL_IMPORT
|
||||
# endif
|
||||
#else
|
||||
# define ALIBABACLOUD_DOCUMENTAUTOML_EXPORT
|
||||
#endif
|
||||
|
||||
#endif // !ALIBABACLOUD_DOCUMENTAUTOML_DOCUMENTAUTOMLEXPORT_H_
|
||||
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_DOCUMENTAUTOML_MODEL_CREATEMODELASYNCPREDICTREQUEST_H_
|
||||
#define ALIBABACLOUD_DOCUMENTAUTOML_MODEL_CREATEMODELASYNCPREDICTREQUEST_H_
|
||||
|
||||
#include <alibabacloud/documentautoml/DocumentAutomlExport.h>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
namespace AlibabaCloud {
|
||||
namespace DocumentAutoml {
|
||||
namespace Model {
|
||||
class ALIBABACLOUD_DOCUMENTAUTOML_EXPORT CreateModelAsyncPredictRequest : public RpcServiceRequest {
|
||||
public:
|
||||
CreateModelAsyncPredictRequest();
|
||||
~CreateModelAsyncPredictRequest();
|
||||
std::string getBody() const;
|
||||
void setBody(const std::string &body);
|
||||
bool getBinaryToText() const;
|
||||
void setBinaryToText(bool binaryToText);
|
||||
std::string getContent() const;
|
||||
void setContent(const std::string &content);
|
||||
std::string getServiceName() const;
|
||||
void setServiceName(const std::string &serviceName);
|
||||
std::string getProduct() const;
|
||||
void setProduct(const std::string &product);
|
||||
long getModelId() const;
|
||||
void setModelId(long modelId);
|
||||
std::string getServiceVersion() const;
|
||||
void setServiceVersion(const std::string &serviceVersion);
|
||||
std::string getModelVersion() const;
|
||||
void setModelVersion(const std::string &modelVersion);
|
||||
|
||||
private:
|
||||
std::string body_;
|
||||
bool binaryToText_;
|
||||
std::string content_;
|
||||
std::string serviceName_;
|
||||
std::string product_;
|
||||
long modelId_;
|
||||
std::string serviceVersion_;
|
||||
std::string modelVersion_;
|
||||
};
|
||||
} // namespace Model
|
||||
} // namespace DocumentAutoml
|
||||
} // namespace AlibabaCloud
|
||||
#endif // !ALIBABACLOUD_DOCUMENTAUTOML_MODEL_CREATEMODELASYNCPREDICTREQUEST_H_
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_DOCUMENTAUTOML_MODEL_CREATEMODELASYNCPREDICTRESULT_H_
|
||||
#define ALIBABACLOUD_DOCUMENTAUTOML_MODEL_CREATEMODELASYNCPREDICTRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/documentautoml/DocumentAutomlExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace DocumentAutoml
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_DOCUMENTAUTOML_EXPORT CreateModelAsyncPredictResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
CreateModelAsyncPredictResult();
|
||||
explicit CreateModelAsyncPredictResult(const std::string &payload);
|
||||
~CreateModelAsyncPredictResult();
|
||||
std::string getMessage()const;
|
||||
std::string getData()const;
|
||||
int getCode()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::string message_;
|
||||
std::string data_;
|
||||
int code_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_DOCUMENTAUTOML_MODEL_CREATEMODELASYNCPREDICTRESULT_H_
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_DOCUMENTAUTOML_MODEL_GETMODELASYNCPREDICTREQUEST_H_
|
||||
#define ALIBABACLOUD_DOCUMENTAUTOML_MODEL_GETMODELASYNCPREDICTREQUEST_H_
|
||||
|
||||
#include <alibabacloud/documentautoml/DocumentAutomlExport.h>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
namespace AlibabaCloud {
|
||||
namespace DocumentAutoml {
|
||||
namespace Model {
|
||||
class ALIBABACLOUD_DOCUMENTAUTOML_EXPORT GetModelAsyncPredictRequest : public RpcServiceRequest {
|
||||
public:
|
||||
GetModelAsyncPredictRequest();
|
||||
~GetModelAsyncPredictRequest();
|
||||
long getAsyncPredictId() const;
|
||||
void setAsyncPredictId(long asyncPredictId);
|
||||
std::string getProduct() const;
|
||||
void setProduct(const std::string &product);
|
||||
|
||||
private:
|
||||
long asyncPredictId_;
|
||||
std::string product_;
|
||||
};
|
||||
} // namespace Model
|
||||
} // namespace DocumentAutoml
|
||||
} // namespace AlibabaCloud
|
||||
#endif // !ALIBABACLOUD_DOCUMENTAUTOML_MODEL_GETMODELASYNCPREDICTREQUEST_H_
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_DOCUMENTAUTOML_MODEL_GETMODELASYNCPREDICTRESULT_H_
|
||||
#define ALIBABACLOUD_DOCUMENTAUTOML_MODEL_GETMODELASYNCPREDICTRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/documentautoml/DocumentAutomlExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace DocumentAutoml
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_DOCUMENTAUTOML_EXPORT GetModelAsyncPredictResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
GetModelAsyncPredictResult();
|
||||
explicit GetModelAsyncPredictResult(const std::string &payload);
|
||||
~GetModelAsyncPredictResult();
|
||||
std::string getMessage()const;
|
||||
std::string getData()const;
|
||||
int getCode()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::string message_;
|
||||
std::string data_;
|
||||
int code_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_DOCUMENTAUTOML_MODEL_GETMODELASYNCPREDICTRESULT_H_
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_DOCUMENTAUTOML_MODEL_PREDICTCLASSIFIERMODELREQUEST_H_
|
||||
#define ALIBABACLOUD_DOCUMENTAUTOML_MODEL_PREDICTCLASSIFIERMODELREQUEST_H_
|
||||
|
||||
#include <alibabacloud/documentautoml/DocumentAutomlExport.h>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
namespace AlibabaCloud {
|
||||
namespace DocumentAutoml {
|
||||
namespace Model {
|
||||
class ALIBABACLOUD_DOCUMENTAUTOML_EXPORT PredictClassifierModelRequest : public RpcServiceRequest {
|
||||
public:
|
||||
PredictClassifierModelRequest();
|
||||
~PredictClassifierModelRequest();
|
||||
std::string getBody() const;
|
||||
void setBody(const std::string &body);
|
||||
std::string getContent() const;
|
||||
void setContent(const std::string &content);
|
||||
long getClassifierId() const;
|
||||
void setClassifierId(long classifierId);
|
||||
bool getAutoPrediction() const;
|
||||
void setAutoPrediction(bool autoPrediction);
|
||||
|
||||
private:
|
||||
std::string body_;
|
||||
std::string content_;
|
||||
long classifierId_;
|
||||
bool autoPrediction_;
|
||||
};
|
||||
} // namespace Model
|
||||
} // namespace DocumentAutoml
|
||||
} // namespace AlibabaCloud
|
||||
#endif // !ALIBABACLOUD_DOCUMENTAUTOML_MODEL_PREDICTCLASSIFIERMODELREQUEST_H_
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_DOCUMENTAUTOML_MODEL_PREDICTCLASSIFIERMODELRESULT_H_
|
||||
#define ALIBABACLOUD_DOCUMENTAUTOML_MODEL_PREDICTCLASSIFIERMODELRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/documentautoml/DocumentAutomlExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace DocumentAutoml
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_DOCUMENTAUTOML_EXPORT PredictClassifierModelResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
PredictClassifierModelResult();
|
||||
explicit PredictClassifierModelResult(const std::string &payload);
|
||||
~PredictClassifierModelResult();
|
||||
std::string getMessage()const;
|
||||
std::string getData()const;
|
||||
int getCode()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::string message_;
|
||||
std::string data_;
|
||||
int code_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_DOCUMENTAUTOML_MODEL_PREDICTCLASSIFIERMODELRESULT_H_
|
||||
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_DOCUMENTAUTOML_MODEL_PREDICTMODELREQUEST_H_
|
||||
#define ALIBABACLOUD_DOCUMENTAUTOML_MODEL_PREDICTMODELREQUEST_H_
|
||||
|
||||
#include <alibabacloud/documentautoml/DocumentAutomlExport.h>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
namespace AlibabaCloud {
|
||||
namespace DocumentAutoml {
|
||||
namespace Model {
|
||||
class ALIBABACLOUD_DOCUMENTAUTOML_EXPORT PredictModelRequest : public RpcServiceRequest {
|
||||
public:
|
||||
PredictModelRequest();
|
||||
~PredictModelRequest();
|
||||
std::string getBody() const;
|
||||
void setBody(const std::string &body);
|
||||
std::string getContent() const;
|
||||
void setContent(const std::string &content);
|
||||
bool getBinaryToText() const;
|
||||
void setBinaryToText(bool binaryToText);
|
||||
std::string getProduct() const;
|
||||
void setProduct(const std::string &product);
|
||||
long getModelId() const;
|
||||
void setModelId(long modelId);
|
||||
std::string getModelVersion() const;
|
||||
void setModelVersion(const std::string &modelVersion);
|
||||
|
||||
private:
|
||||
std::string body_;
|
||||
std::string content_;
|
||||
bool binaryToText_;
|
||||
std::string product_;
|
||||
long modelId_;
|
||||
std::string modelVersion_;
|
||||
};
|
||||
} // namespace Model
|
||||
} // namespace DocumentAutoml
|
||||
} // namespace AlibabaCloud
|
||||
#endif // !ALIBABACLOUD_DOCUMENTAUTOML_MODEL_PREDICTMODELREQUEST_H_
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_DOCUMENTAUTOML_MODEL_PREDICTMODELRESULT_H_
|
||||
#define ALIBABACLOUD_DOCUMENTAUTOML_MODEL_PREDICTMODELRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/documentautoml/DocumentAutomlExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace DocumentAutoml
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_DOCUMENTAUTOML_EXPORT PredictModelResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
PredictModelResult();
|
||||
explicit PredictModelResult(const std::string &payload);
|
||||
~PredictModelResult();
|
||||
std::string getMessage()const;
|
||||
std::string getData()const;
|
||||
int getCode()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::string message_;
|
||||
std::string data_;
|
||||
int code_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_DOCUMENTAUTOML_MODEL_PREDICTMODELRESULT_H_
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_DOCUMENTAUTOML_MODEL_PREDICTTEMPLATEMODELREQUEST_H_
|
||||
#define ALIBABACLOUD_DOCUMENTAUTOML_MODEL_PREDICTTEMPLATEMODELREQUEST_H_
|
||||
|
||||
#include <alibabacloud/documentautoml/DocumentAutomlExport.h>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
namespace AlibabaCloud {
|
||||
namespace DocumentAutoml {
|
||||
namespace Model {
|
||||
class ALIBABACLOUD_DOCUMENTAUTOML_EXPORT PredictTemplateModelRequest : public RpcServiceRequest {
|
||||
public:
|
||||
PredictTemplateModelRequest();
|
||||
~PredictTemplateModelRequest();
|
||||
std::string getBody() const;
|
||||
void setBody(const std::string &body);
|
||||
std::string getContent() const;
|
||||
void setContent(const std::string &content);
|
||||
bool getBinaryToText() const;
|
||||
void setBinaryToText(bool binaryToText);
|
||||
long getTaskId() const;
|
||||
void setTaskId(long taskId);
|
||||
std::string getProduct() const;
|
||||
void setProduct(const std::string &product);
|
||||
|
||||
private:
|
||||
std::string body_;
|
||||
std::string content_;
|
||||
bool binaryToText_;
|
||||
long taskId_;
|
||||
std::string product_;
|
||||
};
|
||||
} // namespace Model
|
||||
} // namespace DocumentAutoml
|
||||
} // namespace AlibabaCloud
|
||||
#endif // !ALIBABACLOUD_DOCUMENTAUTOML_MODEL_PREDICTTEMPLATEMODELREQUEST_H_
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_DOCUMENTAUTOML_MODEL_PREDICTTEMPLATEMODELRESULT_H_
|
||||
#define ALIBABACLOUD_DOCUMENTAUTOML_MODEL_PREDICTTEMPLATEMODELRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/documentautoml/DocumentAutomlExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace DocumentAutoml
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_DOCUMENTAUTOML_EXPORT PredictTemplateModelResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
PredictTemplateModelResult();
|
||||
explicit PredictTemplateModelResult(const std::string &payload);
|
||||
~PredictTemplateModelResult();
|
||||
std::string getMessage()const;
|
||||
std::string getData()const;
|
||||
std::string getCode()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::string message_;
|
||||
std::string data_;
|
||||
std::string code_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_DOCUMENTAUTOML_MODEL_PREDICTTEMPLATEMODELRESULT_H_
|
||||
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