diff --git a/VERSION b/VERSION index a82089bdb..81e4362e7 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.1526 \ No newline at end of file +1.36.1527 \ No newline at end of file diff --git a/documentautoml/CMakeLists.txt b/documentautoml/CMakeLists.txt new file mode 100644 index 000000000..5d5b9d7b2 --- /dev/null +++ b/documentautoml/CMakeLists.txt @@ -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} + ) \ No newline at end of file diff --git a/documentautoml/include/alibabacloud/documentautoml/DocumentAutomlClient.h b/documentautoml/include/alibabacloud/documentautoml/DocumentAutomlClient.h new file mode 100644 index 000000000..2c652fcbb --- /dev/null +++ b/documentautoml/include/alibabacloud/documentautoml/DocumentAutomlClient.h @@ -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 +#include +#include +#include +#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 CreateModelAsyncPredictOutcome; + typedef std::future CreateModelAsyncPredictOutcomeCallable; + typedef std::function&)> CreateModelAsyncPredictAsyncHandler; + typedef Outcome GetModelAsyncPredictOutcome; + typedef std::future GetModelAsyncPredictOutcomeCallable; + typedef std::function&)> GetModelAsyncPredictAsyncHandler; + typedef Outcome PredictClassifierModelOutcome; + typedef std::future PredictClassifierModelOutcomeCallable; + typedef std::function&)> PredictClassifierModelAsyncHandler; + typedef Outcome PredictModelOutcome; + typedef std::future PredictModelOutcomeCallable; + typedef std::function&)> PredictModelAsyncHandler; + typedef Outcome PredictTemplateModelOutcome; + typedef std::future PredictTemplateModelOutcomeCallable; + typedef std::function&)> PredictTemplateModelAsyncHandler; + + DocumentAutomlClient(const Credentials &credentials, const ClientConfiguration &configuration); + DocumentAutomlClient(const std::shared_ptr &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& 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& 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& 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& 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& context = nullptr) const; + PredictTemplateModelOutcomeCallable predictTemplateModelCallable(const Model::PredictTemplateModelRequest& request) const; + + private: + std::shared_ptr endpointProvider_; + }; + } +} + +#endif // !ALIBABACLOUD_DOCUMENTAUTOML_DOCUMENTAUTOMLCLIENT_H_ diff --git a/documentautoml/include/alibabacloud/documentautoml/DocumentAutomlExport.h b/documentautoml/include/alibabacloud/documentautoml/DocumentAutomlExport.h new file mode 100644 index 000000000..8069c7fba --- /dev/null +++ b/documentautoml/include/alibabacloud/documentautoml/DocumentAutomlExport.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 + +#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_ \ No newline at end of file diff --git a/documentautoml/include/alibabacloud/documentautoml/model/CreateModelAsyncPredictRequest.h b/documentautoml/include/alibabacloud/documentautoml/model/CreateModelAsyncPredictRequest.h new file mode 100644 index 000000000..194837eba --- /dev/null +++ b/documentautoml/include/alibabacloud/documentautoml/model/CreateModelAsyncPredictRequest.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 +#include +#include +#include +#include + +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_ diff --git a/documentautoml/include/alibabacloud/documentautoml/model/CreateModelAsyncPredictResult.h b/documentautoml/include/alibabacloud/documentautoml/model/CreateModelAsyncPredictResult.h new file mode 100644 index 000000000..aa5d6314f --- /dev/null +++ b/documentautoml/include/alibabacloud/documentautoml/model/CreateModelAsyncPredictResult.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 +#include +#include +#include +#include + +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_ \ No newline at end of file diff --git a/documentautoml/include/alibabacloud/documentautoml/model/GetModelAsyncPredictRequest.h b/documentautoml/include/alibabacloud/documentautoml/model/GetModelAsyncPredictRequest.h new file mode 100644 index 000000000..dbacd5be0 --- /dev/null +++ b/documentautoml/include/alibabacloud/documentautoml/model/GetModelAsyncPredictRequest.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 +#include +#include +#include +#include + +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_ diff --git a/documentautoml/include/alibabacloud/documentautoml/model/GetModelAsyncPredictResult.h b/documentautoml/include/alibabacloud/documentautoml/model/GetModelAsyncPredictResult.h new file mode 100644 index 000000000..5e4ce31e4 --- /dev/null +++ b/documentautoml/include/alibabacloud/documentautoml/model/GetModelAsyncPredictResult.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 +#include +#include +#include +#include + +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_ \ No newline at end of file diff --git a/documentautoml/include/alibabacloud/documentautoml/model/PredictClassifierModelRequest.h b/documentautoml/include/alibabacloud/documentautoml/model/PredictClassifierModelRequest.h new file mode 100644 index 000000000..9b4fa9ec8 --- /dev/null +++ b/documentautoml/include/alibabacloud/documentautoml/model/PredictClassifierModelRequest.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 +#include +#include +#include +#include + +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_ diff --git a/documentautoml/include/alibabacloud/documentautoml/model/PredictClassifierModelResult.h b/documentautoml/include/alibabacloud/documentautoml/model/PredictClassifierModelResult.h new file mode 100644 index 000000000..c998a16cd --- /dev/null +++ b/documentautoml/include/alibabacloud/documentautoml/model/PredictClassifierModelResult.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 +#include +#include +#include +#include + +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_ \ No newline at end of file diff --git a/documentautoml/include/alibabacloud/documentautoml/model/PredictModelRequest.h b/documentautoml/include/alibabacloud/documentautoml/model/PredictModelRequest.h new file mode 100644 index 000000000..d4b52506c --- /dev/null +++ b/documentautoml/include/alibabacloud/documentautoml/model/PredictModelRequest.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 +#include +#include +#include +#include + +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_ diff --git a/documentautoml/include/alibabacloud/documentautoml/model/PredictModelResult.h b/documentautoml/include/alibabacloud/documentautoml/model/PredictModelResult.h new file mode 100644 index 000000000..9004a36bd --- /dev/null +++ b/documentautoml/include/alibabacloud/documentautoml/model/PredictModelResult.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 +#include +#include +#include +#include + +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_ \ No newline at end of file diff --git a/documentautoml/include/alibabacloud/documentautoml/model/PredictTemplateModelRequest.h b/documentautoml/include/alibabacloud/documentautoml/model/PredictTemplateModelRequest.h new file mode 100644 index 000000000..4070746cd --- /dev/null +++ b/documentautoml/include/alibabacloud/documentautoml/model/PredictTemplateModelRequest.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 +#include +#include +#include +#include + +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_ diff --git a/documentautoml/include/alibabacloud/documentautoml/model/PredictTemplateModelResult.h b/documentautoml/include/alibabacloud/documentautoml/model/PredictTemplateModelResult.h new file mode 100644 index 000000000..d7ea9a0b9 --- /dev/null +++ b/documentautoml/include/alibabacloud/documentautoml/model/PredictTemplateModelResult.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 +#include +#include +#include +#include + +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_ \ No newline at end of file diff --git a/documentautoml/src/DocumentAutomlClient.cc b/documentautoml/src/DocumentAutomlClient.cc new file mode 100644 index 000000000..b403daf3b --- /dev/null +++ b/documentautoml/src/DocumentAutomlClient.cc @@ -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 +#include + +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(credentials), configuration) +{ + auto locationClient = std::make_shared(credentials, configuration); + endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, "documentAutoml"); +} + +DocumentAutomlClient::DocumentAutomlClient(const std::shared_ptr& credentialsProvider, const ClientConfiguration & configuration) : + RpcServiceClient(SERVICE_NAME, credentialsProvider, configuration) +{ + auto locationClient = std::make_shared(credentialsProvider, configuration); + endpointProvider_ = std::make_shared(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(accessKeyId, accessKeySecret), configuration) +{ + auto locationClient = std::make_shared(accessKeyId, accessKeySecret, configuration); + endpointProvider_ = std::make_shared(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& 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>( + [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& 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>( + [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& 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>( + [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& 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>( + [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& 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>( + [this, request]() + { + return this->predictTemplateModel(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + diff --git a/documentautoml/src/model/CreateModelAsyncPredictRequest.cc b/documentautoml/src/model/CreateModelAsyncPredictRequest.cc new file mode 100644 index 000000000..df2f4f3d8 --- /dev/null +++ b/documentautoml/src/model/CreateModelAsyncPredictRequest.cc @@ -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 + +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); +} + diff --git a/documentautoml/src/model/CreateModelAsyncPredictResult.cc b/documentautoml/src/model/CreateModelAsyncPredictResult.cc new file mode 100644 index 000000000..fb51e556f --- /dev/null +++ b/documentautoml/src/model/CreateModelAsyncPredictResult.cc @@ -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 +#include + +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_; +} + diff --git a/documentautoml/src/model/GetModelAsyncPredictRequest.cc b/documentautoml/src/model/GetModelAsyncPredictRequest.cc new file mode 100644 index 000000000..76af065b3 --- /dev/null +++ b/documentautoml/src/model/GetModelAsyncPredictRequest.cc @@ -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 + +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); +} + diff --git a/documentautoml/src/model/GetModelAsyncPredictResult.cc b/documentautoml/src/model/GetModelAsyncPredictResult.cc new file mode 100644 index 000000000..068d3782e --- /dev/null +++ b/documentautoml/src/model/GetModelAsyncPredictResult.cc @@ -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 +#include + +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_; +} + diff --git a/documentautoml/src/model/PredictClassifierModelRequest.cc b/documentautoml/src/model/PredictClassifierModelRequest.cc new file mode 100644 index 000000000..6d0d58594 --- /dev/null +++ b/documentautoml/src/model/PredictClassifierModelRequest.cc @@ -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 + +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"); +} + diff --git a/documentautoml/src/model/PredictClassifierModelResult.cc b/documentautoml/src/model/PredictClassifierModelResult.cc new file mode 100644 index 000000000..84e0e7e4d --- /dev/null +++ b/documentautoml/src/model/PredictClassifierModelResult.cc @@ -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 +#include + +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_; +} + diff --git a/documentautoml/src/model/PredictModelRequest.cc b/documentautoml/src/model/PredictModelRequest.cc new file mode 100644 index 000000000..52eba8977 --- /dev/null +++ b/documentautoml/src/model/PredictModelRequest.cc @@ -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 + +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); +} + diff --git a/documentautoml/src/model/PredictModelResult.cc b/documentautoml/src/model/PredictModelResult.cc new file mode 100644 index 000000000..7f50cb033 --- /dev/null +++ b/documentautoml/src/model/PredictModelResult.cc @@ -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 +#include + +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_; +} + diff --git a/documentautoml/src/model/PredictTemplateModelRequest.cc b/documentautoml/src/model/PredictTemplateModelRequest.cc new file mode 100644 index 000000000..af18c95fe --- /dev/null +++ b/documentautoml/src/model/PredictTemplateModelRequest.cc @@ -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 + +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); +} + diff --git a/documentautoml/src/model/PredictTemplateModelResult.cc b/documentautoml/src/model/PredictTemplateModelResult.cc new file mode 100644 index 000000000..861b41112 --- /dev/null +++ b/documentautoml/src/model/PredictTemplateModelResult.cc @@ -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 +#include + +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_; +} +