diff --git a/CHANGELOG b/CHANGELOG index 81bc45b35..e1a1b8d1e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2020-04-15 Version: 1.36.356 +- Vision-poc response modified. + 2020-04-14 Version: 1.36.355 - Support ListSensitiveColumns, ListSensitiveColumnsDetail API. - ListUsers API return user execute query count information. diff --git a/VERSION b/VERSION index f6ab52434..14154b703 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.355 \ No newline at end of file +1.36.356 \ No newline at end of file diff --git a/visionai-poc/CMakeLists.txt b/visionai-poc/CMakeLists.txt new file mode 100644 index 000000000..05461e6cb --- /dev/null +++ b/visionai-poc/CMakeLists.txt @@ -0,0 +1,110 @@ +# +# 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(visionai-poc_public_header + include/alibabacloud/visionai-poc/Visionai_pocClient.h + include/alibabacloud/visionai-poc/Visionai_pocExport.h ) + +set(visionai-poc_public_header_model + include/alibabacloud/visionai-poc/model/CheckMultiagentRequest.h + include/alibabacloud/visionai-poc/model/CheckMultiagentResult.h + include/alibabacloud/visionai-poc/model/PredictCategoryRequest.h + include/alibabacloud/visionai-poc/model/PredictCategoryResult.h + include/alibabacloud/visionai-poc/model/RecognizeCarRequest.h + include/alibabacloud/visionai-poc/model/RecognizeCarResult.h + include/alibabacloud/visionai-poc/model/RecognizeEntityRequest.h + include/alibabacloud/visionai-poc/model/RecognizeEntityResult.h + include/alibabacloud/visionai-poc/model/RecognizeFlowerRequest.h + include/alibabacloud/visionai-poc/model/RecognizeFlowerResult.h + include/alibabacloud/visionai-poc/model/RecognizeLabelRequest.h + include/alibabacloud/visionai-poc/model/RecognizeLabelResult.h + include/alibabacloud/visionai-poc/model/RecognizePetRequest.h + include/alibabacloud/visionai-poc/model/RecognizePetResult.h ) + +set(visionai-poc_src + src/Visionai-pocClient.cc + src/model/CheckMultiagentRequest.cc + src/model/CheckMultiagentResult.cc + src/model/PredictCategoryRequest.cc + src/model/PredictCategoryResult.cc + src/model/RecognizeCarRequest.cc + src/model/RecognizeCarResult.cc + src/model/RecognizeEntityRequest.cc + src/model/RecognizeEntityResult.cc + src/model/RecognizeFlowerRequest.cc + src/model/RecognizeFlowerResult.cc + src/model/RecognizeLabelRequest.cc + src/model/RecognizeLabelResult.cc + src/model/RecognizePetRequest.cc + src/model/RecognizePetResult.cc ) + +add_library(visionai-poc ${LIB_TYPE} + ${visionai-poc_public_header} + ${visionai-poc_public_header_model} + ${visionai-poc_src}) + +set_target_properties(visionai-poc + 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}visionai-poc + ) + +if(${LIB_TYPE} STREQUAL "SHARED") + set_target_properties(visionai-poc + PROPERTIES + DEFINE_SYMBOL ALIBABACLOUD_VISIONAI_POC_LIBRARY) +endif() + +target_include_directories(visionai-poc + PRIVATE include + ${CMAKE_SOURCE_DIR}/core/include + ) +target_link_libraries(visionai-poc + core) + +if(CMAKE_HOST_WIN32) + ExternalProject_Get_Property(jsoncpp INSTALL_DIR) + set(jsoncpp_install_dir ${INSTALL_DIR}) + add_dependencies(visionai-poc + jsoncpp) + target_include_directories(visionai-poc + PRIVATE ${jsoncpp_install_dir}/include) + target_link_libraries(visionai-poc + ${jsoncpp_install_dir}/lib/jsoncpp.lib) + set_target_properties(visionai-poc + PROPERTIES + COMPILE_OPTIONS "/bigobj") +else() + target_include_directories(visionai-poc + PRIVATE /usr/include/jsoncpp) + target_link_libraries(visionai-poc + jsoncpp) +endif() + +install(FILES ${visionai-poc_public_header} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/visionai-poc) +install(FILES ${visionai-poc_public_header_model} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/visionai-poc/model) +install(TARGETS visionai-poc + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ) \ No newline at end of file diff --git a/visionai-poc/include/alibabacloud/visionai-poc/Visionai_pocClient.h b/visionai-poc/include/alibabacloud/visionai-poc/Visionai_pocClient.h new file mode 100644 index 000000000..c031e0b5d --- /dev/null +++ b/visionai-poc/include/alibabacloud/visionai-poc/Visionai_pocClient.h @@ -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. + */ + +#ifndef ALIBABACLOUD_VISIONAI_POC_VISIONAI_POCCLIENT_H_ +#define ALIBABACLOUD_VISIONAI_POC_VISIONAI_POCCLIENT_H_ + +#include +#include +#include +#include +#include "Visionai_pocExport.h" +#include "model/CheckMultiagentRequest.h" +#include "model/CheckMultiagentResult.h" +#include "model/PredictCategoryRequest.h" +#include "model/PredictCategoryResult.h" +#include "model/RecognizeCarRequest.h" +#include "model/RecognizeCarResult.h" +#include "model/RecognizeEntityRequest.h" +#include "model/RecognizeEntityResult.h" +#include "model/RecognizeFlowerRequest.h" +#include "model/RecognizeFlowerResult.h" +#include "model/RecognizeLabelRequest.h" +#include "model/RecognizeLabelResult.h" +#include "model/RecognizePetRequest.h" +#include "model/RecognizePetResult.h" + + +namespace AlibabaCloud +{ + namespace Visionai_poc + { + class ALIBABACLOUD_VISIONAI_POC_EXPORT Visionai_pocClient : public RpcServiceClient + { + public: + typedef Outcome CheckMultiagentOutcome; + typedef std::future CheckMultiagentOutcomeCallable; + typedef std::function&)> CheckMultiagentAsyncHandler; + typedef Outcome PredictCategoryOutcome; + typedef std::future PredictCategoryOutcomeCallable; + typedef std::function&)> PredictCategoryAsyncHandler; + typedef Outcome RecognizeCarOutcome; + typedef std::future RecognizeCarOutcomeCallable; + typedef std::function&)> RecognizeCarAsyncHandler; + typedef Outcome RecognizeEntityOutcome; + typedef std::future RecognizeEntityOutcomeCallable; + typedef std::function&)> RecognizeEntityAsyncHandler; + typedef Outcome RecognizeFlowerOutcome; + typedef std::future RecognizeFlowerOutcomeCallable; + typedef std::function&)> RecognizeFlowerAsyncHandler; + typedef Outcome RecognizeLabelOutcome; + typedef std::future RecognizeLabelOutcomeCallable; + typedef std::function&)> RecognizeLabelAsyncHandler; + typedef Outcome RecognizePetOutcome; + typedef std::future RecognizePetOutcomeCallable; + typedef std::function&)> RecognizePetAsyncHandler; + + Visionai_pocClient(const Credentials &credentials, const ClientConfiguration &configuration); + Visionai_pocClient(const std::shared_ptr &credentialsProvider, const ClientConfiguration &configuration); + Visionai_pocClient(const std::string &accessKeyId, const std::string &accessKeySecret, const ClientConfiguration &configuration); + ~Visionai_pocClient(); + CheckMultiagentOutcome checkMultiagent(const Model::CheckMultiagentRequest &request)const; + void checkMultiagentAsync(const Model::CheckMultiagentRequest& request, const CheckMultiagentAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + CheckMultiagentOutcomeCallable checkMultiagentCallable(const Model::CheckMultiagentRequest& request) const; + PredictCategoryOutcome predictCategory(const Model::PredictCategoryRequest &request)const; + void predictCategoryAsync(const Model::PredictCategoryRequest& request, const PredictCategoryAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + PredictCategoryOutcomeCallable predictCategoryCallable(const Model::PredictCategoryRequest& request) const; + RecognizeCarOutcome recognizeCar(const Model::RecognizeCarRequest &request)const; + void recognizeCarAsync(const Model::RecognizeCarRequest& request, const RecognizeCarAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + RecognizeCarOutcomeCallable recognizeCarCallable(const Model::RecognizeCarRequest& request) const; + RecognizeEntityOutcome recognizeEntity(const Model::RecognizeEntityRequest &request)const; + void recognizeEntityAsync(const Model::RecognizeEntityRequest& request, const RecognizeEntityAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + RecognizeEntityOutcomeCallable recognizeEntityCallable(const Model::RecognizeEntityRequest& request) const; + RecognizeFlowerOutcome recognizeFlower(const Model::RecognizeFlowerRequest &request)const; + void recognizeFlowerAsync(const Model::RecognizeFlowerRequest& request, const RecognizeFlowerAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + RecognizeFlowerOutcomeCallable recognizeFlowerCallable(const Model::RecognizeFlowerRequest& request) const; + RecognizeLabelOutcome recognizeLabel(const Model::RecognizeLabelRequest &request)const; + void recognizeLabelAsync(const Model::RecognizeLabelRequest& request, const RecognizeLabelAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + RecognizeLabelOutcomeCallable recognizeLabelCallable(const Model::RecognizeLabelRequest& request) const; + RecognizePetOutcome recognizePet(const Model::RecognizePetRequest &request)const; + void recognizePetAsync(const Model::RecognizePetRequest& request, const RecognizePetAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + RecognizePetOutcomeCallable recognizePetCallable(const Model::RecognizePetRequest& request) const; + + private: + std::shared_ptr endpointProvider_; + }; + } +} + +#endif // !ALIBABACLOUD_VISIONAI_POC_VISIONAI_POCCLIENT_H_ diff --git a/visionai-poc/include/alibabacloud/visionai-poc/Visionai_pocExport.h b/visionai-poc/include/alibabacloud/visionai-poc/Visionai_pocExport.h new file mode 100644 index 000000000..458637278 --- /dev/null +++ b/visionai-poc/include/alibabacloud/visionai-poc/Visionai_pocExport.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_VISIONAI_POC_VISIONAI_POCEXPORT_H_ +#define ALIBABACLOUD_VISIONAI_POC_VISIONAI_POCEXPORT_H_ + +#include + +#if defined(ALIBABACLOUD_SHARED) +# if defined(ALIBABACLOUD_VISIONAI_POC_LIBRARY) +# define ALIBABACLOUD_VISIONAI_POC_EXPORT ALIBABACLOUD_DECL_EXPORT +# else +# define ALIBABACLOUD_VISIONAI_POC_EXPORT ALIBABACLOUD_DECL_IMPORT +# endif +#else +# define ALIBABACLOUD_VISIONAI_POC_EXPORT +#endif + +#endif // !ALIBABACLOUD_VISIONAI_POC_VISIONAI_POCEXPORT_H_ \ No newline at end of file diff --git a/visionai-poc/include/alibabacloud/visionai-poc/model/CheckMultiagentRequest.h b/visionai-poc/include/alibabacloud/visionai-poc/model/CheckMultiagentRequest.h new file mode 100644 index 000000000..a75e88cf0 --- /dev/null +++ b/visionai-poc/include/alibabacloud/visionai-poc/model/CheckMultiagentRequest.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_VISIONAI_POC_MODEL_CHECKMULTIAGENTREQUEST_H_ +#define ALIBABACLOUD_VISIONAI_POC_MODEL_CHECKMULTIAGENTREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Visionai_poc + { + namespace Model + { + class ALIBABACLOUD_VISIONAI_POC_EXPORT CheckMultiagentRequest : public RpcServiceRequest + { + + public: + CheckMultiagentRequest(); + ~CheckMultiagentRequest(); + + std::string getMethod()const; + void setMethod(const std::string& method); + std::string getImageUrl()const; + void setImageUrl(const std::string& imageUrl); + std::string getUrl()const; + void setUrl(const std::string& url); + + private: + std::string method_; + std::string imageUrl_; + std::string url_; + + }; + } + } +} +#endif // !ALIBABACLOUD_VISIONAI_POC_MODEL_CHECKMULTIAGENTREQUEST_H_ \ No newline at end of file diff --git a/visionai-poc/include/alibabacloud/visionai-poc/model/CheckMultiagentResult.h b/visionai-poc/include/alibabacloud/visionai-poc/model/CheckMultiagentResult.h new file mode 100644 index 000000000..65655a785 --- /dev/null +++ b/visionai-poc/include/alibabacloud/visionai-poc/model/CheckMultiagentResult.h @@ -0,0 +1,66 @@ +/* + * 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_VISIONAI_POC_MODEL_CHECKMULTIAGENTRESULT_H_ +#define ALIBABACLOUD_VISIONAI_POC_MODEL_CHECKMULTIAGENTRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Visionai_poc + { + namespace Model + { + class ALIBABACLOUD_VISIONAI_POC_EXPORT CheckMultiagentResult : public ServiceResult + { + public: + struct Response + { + std::string requestId; + std::string data; + std::string errorCode; + std::string errorMessage; + bool success; + std::string url; + }; + + + CheckMultiagentResult(); + explicit CheckMultiagentResult(const std::string &payload); + ~CheckMultiagentResult(); + Response getResponse()const; + std::string getMessage()const; + std::string getCode()const; + bool getSuccess()const; + + protected: + void parse(const std::string &payload); + private: + Response response_; + std::string message_; + std::string code_; + bool success_; + + }; + } + } +} +#endif // !ALIBABACLOUD_VISIONAI_POC_MODEL_CHECKMULTIAGENTRESULT_H_ \ No newline at end of file diff --git a/visionai-poc/include/alibabacloud/visionai-poc/model/PredictCategoryRequest.h b/visionai-poc/include/alibabacloud/visionai-poc/model/PredictCategoryRequest.h new file mode 100644 index 000000000..289b37ac6 --- /dev/null +++ b/visionai-poc/include/alibabacloud/visionai-poc/model/PredictCategoryRequest.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_VISIONAI_POC_MODEL_PREDICTCATEGORYREQUEST_H_ +#define ALIBABACLOUD_VISIONAI_POC_MODEL_PREDICTCATEGORYREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Visionai_poc + { + namespace Model + { + class ALIBABACLOUD_VISIONAI_POC_EXPORT PredictCategoryRequest : public RpcServiceRequest + { + + public: + PredictCategoryRequest(); + ~PredictCategoryRequest(); + + std::string getMethod()const; + void setMethod(const std::string& method); + std::string getImageUrl()const; + void setImageUrl(const std::string& imageUrl); + std::string getTitle()const; + void setTitle(const std::string& title); + std::string getUrl()const; + void setUrl(const std::string& url); + + private: + std::string method_; + std::string imageUrl_; + std::string title_; + std::string url_; + + }; + } + } +} +#endif // !ALIBABACLOUD_VISIONAI_POC_MODEL_PREDICTCATEGORYREQUEST_H_ \ No newline at end of file diff --git a/visionai-poc/include/alibabacloud/visionai-poc/model/PredictCategoryResult.h b/visionai-poc/include/alibabacloud/visionai-poc/model/PredictCategoryResult.h new file mode 100644 index 000000000..aefdc978e --- /dev/null +++ b/visionai-poc/include/alibabacloud/visionai-poc/model/PredictCategoryResult.h @@ -0,0 +1,88 @@ +/* + * 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_VISIONAI_POC_MODEL_PREDICTCATEGORYRESULT_H_ +#define ALIBABACLOUD_VISIONAI_POC_MODEL_PREDICTCATEGORYRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Visionai_poc + { + namespace Model + { + class ALIBABACLOUD_VISIONAI_POC_EXPORT PredictCategoryResult : public ServiceResult + { + public: + struct Response + { + struct Node + { + struct Category + { + std::string cateLevelFiveName; + int cateLevelFourId; + int cateLevelTwoId; + std::string cateName; + int cateId; + std::string cateLevelTwoName; + std::string cateLevelThreeName; + int cateLevelThreeId; + float score; + int cateLevel; + std::string cateLevelOneName; + int cateLevelOneId; + int cateLevelFiveId; + std::string cateLevelFOURName; + }; + Category category; + std::string cateId; + }; + std::string requestId; + std::vector data; + std::string errorCode; + std::string errorMessage; + bool success; + std::string url; + }; + + + PredictCategoryResult(); + explicit PredictCategoryResult(const std::string &payload); + ~PredictCategoryResult(); + Response getResponse()const; + std::string getMessage()const; + int getCode()const; + bool getSuccess()const; + + protected: + void parse(const std::string &payload); + private: + Response response_; + std::string message_; + int code_; + bool success_; + + }; + } + } +} +#endif // !ALIBABACLOUD_VISIONAI_POC_MODEL_PREDICTCATEGORYRESULT_H_ \ No newline at end of file diff --git a/visionai-poc/include/alibabacloud/visionai-poc/model/RecognizeCarRequest.h b/visionai-poc/include/alibabacloud/visionai-poc/model/RecognizeCarRequest.h new file mode 100644 index 000000000..04830cfa7 --- /dev/null +++ b/visionai-poc/include/alibabacloud/visionai-poc/model/RecognizeCarRequest.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_VISIONAI_POC_MODEL_RECOGNIZECARREQUEST_H_ +#define ALIBABACLOUD_VISIONAI_POC_MODEL_RECOGNIZECARREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Visionai_poc + { + namespace Model + { + class ALIBABACLOUD_VISIONAI_POC_EXPORT RecognizeCarRequest : public RpcServiceRequest + { + + public: + RecognizeCarRequest(); + ~RecognizeCarRequest(); + + std::string getMethod()const; + void setMethod(const std::string& method); + std::string getImageUrl()const; + void setImageUrl(const std::string& imageUrl); + std::string getUrl()const; + void setUrl(const std::string& url); + + private: + std::string method_; + std::string imageUrl_; + std::string url_; + + }; + } + } +} +#endif // !ALIBABACLOUD_VISIONAI_POC_MODEL_RECOGNIZECARREQUEST_H_ \ No newline at end of file diff --git a/visionai-poc/include/alibabacloud/visionai-poc/model/RecognizeCarResult.h b/visionai-poc/include/alibabacloud/visionai-poc/model/RecognizeCarResult.h new file mode 100644 index 000000000..1829844fe --- /dev/null +++ b/visionai-poc/include/alibabacloud/visionai-poc/model/RecognizeCarResult.h @@ -0,0 +1,80 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_VISIONAI_POC_MODEL_RECOGNIZECARRESULT_H_ +#define ALIBABACLOUD_VISIONAI_POC_MODEL_RECOGNIZECARRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Visionai_poc + { + namespace Model + { + class ALIBABACLOUD_VISIONAI_POC_EXPORT RecognizeCarResult : public ServiceResult + { + public: + struct Response + { + struct Data + { + std::string modelName; + std::string description; + std::string sptId; + std::string confidence; + std::string prop; + std::string external; + std::string picUrl; + std::string roid; + std::string name; + std::string tips; + std::string predictRes; + }; + std::string requestId; + Data data; + std::string errorCode; + std::string errorMessage; + bool success; + std::string url; + }; + + + RecognizeCarResult(); + explicit RecognizeCarResult(const std::string &payload); + ~RecognizeCarResult(); + Response getResponse()const; + std::string getMessage()const; + int getCode()const; + bool getSuccess()const; + + protected: + void parse(const std::string &payload); + private: + Response response_; + std::string message_; + int code_; + bool success_; + + }; + } + } +} +#endif // !ALIBABACLOUD_VISIONAI_POC_MODEL_RECOGNIZECARRESULT_H_ \ No newline at end of file diff --git a/visionai-poc/include/alibabacloud/visionai-poc/model/RecognizeEntityRequest.h b/visionai-poc/include/alibabacloud/visionai-poc/model/RecognizeEntityRequest.h new file mode 100644 index 000000000..4085344b9 --- /dev/null +++ b/visionai-poc/include/alibabacloud/visionai-poc/model/RecognizeEntityRequest.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_VISIONAI_POC_MODEL_RECOGNIZEENTITYREQUEST_H_ +#define ALIBABACLOUD_VISIONAI_POC_MODEL_RECOGNIZEENTITYREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Visionai_poc + { + namespace Model + { + class ALIBABACLOUD_VISIONAI_POC_EXPORT RecognizeEntityRequest : public RpcServiceRequest + { + + public: + RecognizeEntityRequest(); + ~RecognizeEntityRequest(); + + std::string getMethod()const; + void setMethod(const std::string& method); + std::string getImageUrl()const; + void setImageUrl(const std::string& imageUrl); + std::string getUrl()const; + void setUrl(const std::string& url); + + private: + std::string method_; + std::string imageUrl_; + std::string url_; + + }; + } + } +} +#endif // !ALIBABACLOUD_VISIONAI_POC_MODEL_RECOGNIZEENTITYREQUEST_H_ \ No newline at end of file diff --git a/visionai-poc/include/alibabacloud/visionai-poc/model/RecognizeEntityResult.h b/visionai-poc/include/alibabacloud/visionai-poc/model/RecognizeEntityResult.h new file mode 100644 index 000000000..4bea1d4a1 --- /dev/null +++ b/visionai-poc/include/alibabacloud/visionai-poc/model/RecognizeEntityResult.h @@ -0,0 +1,78 @@ +/* + * 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_VISIONAI_POC_MODEL_RECOGNIZEENTITYRESULT_H_ +#define ALIBABACLOUD_VISIONAI_POC_MODEL_RECOGNIZEENTITYRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Visionai_poc + { + namespace Model + { + class ALIBABACLOUD_VISIONAI_POC_EXPORT RecognizeEntityResult : public ServiceResult + { + public: + struct Response + { + struct Data + { + struct Node + { + std::string score; + std::string tag; + }; + std::string requestId; + int useSubModelResult; + std::vector result; + int callSubModelApi; + }; + std::string requestId; + Data data; + std::string errorCode; + std::string errorMessage; + bool success; + std::string url; + }; + + + RecognizeEntityResult(); + explicit RecognizeEntityResult(const std::string &payload); + ~RecognizeEntityResult(); + Response getResponse()const; + std::string getMessage()const; + int getCode()const; + bool getSuccess()const; + + protected: + void parse(const std::string &payload); + private: + Response response_; + std::string message_; + int code_; + bool success_; + + }; + } + } +} +#endif // !ALIBABACLOUD_VISIONAI_POC_MODEL_RECOGNIZEENTITYRESULT_H_ \ No newline at end of file diff --git a/visionai-poc/include/alibabacloud/visionai-poc/model/RecognizeFlowerRequest.h b/visionai-poc/include/alibabacloud/visionai-poc/model/RecognizeFlowerRequest.h new file mode 100644 index 000000000..0347f82da --- /dev/null +++ b/visionai-poc/include/alibabacloud/visionai-poc/model/RecognizeFlowerRequest.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_VISIONAI_POC_MODEL_RECOGNIZEFLOWERREQUEST_H_ +#define ALIBABACLOUD_VISIONAI_POC_MODEL_RECOGNIZEFLOWERREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Visionai_poc + { + namespace Model + { + class ALIBABACLOUD_VISIONAI_POC_EXPORT RecognizeFlowerRequest : public RpcServiceRequest + { + + public: + RecognizeFlowerRequest(); + ~RecognizeFlowerRequest(); + + std::string getMethod()const; + void setMethod(const std::string& method); + std::string getImageUrl()const; + void setImageUrl(const std::string& imageUrl); + std::string getUrl()const; + void setUrl(const std::string& url); + + private: + std::string method_; + std::string imageUrl_; + std::string url_; + + }; + } + } +} +#endif // !ALIBABACLOUD_VISIONAI_POC_MODEL_RECOGNIZEFLOWERREQUEST_H_ \ No newline at end of file diff --git a/visionai-poc/include/alibabacloud/visionai-poc/model/RecognizeFlowerResult.h b/visionai-poc/include/alibabacloud/visionai-poc/model/RecognizeFlowerResult.h new file mode 100644 index 000000000..651e4679a --- /dev/null +++ b/visionai-poc/include/alibabacloud/visionai-poc/model/RecognizeFlowerResult.h @@ -0,0 +1,87 @@ +/* + * 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_VISIONAI_POC_MODEL_RECOGNIZEFLOWERRESULT_H_ +#define ALIBABACLOUD_VISIONAI_POC_MODEL_RECOGNIZEFLOWERRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Visionai_poc + { + namespace Model + { + class ALIBABACLOUD_VISIONAI_POC_EXPORT RecognizeFlowerResult : public ServiceResult + { + public: + struct Response + { + struct Data + { + struct Node + { + std::string score; + std::string tag; + }; + std::string modelName; + std::string description; + std::string prop; + std::string name; + std::string predictRes; + std::string sptId; + std::vector predictability; + std::string confidence; + std::string version; + std::string external; + std::string picUrl; + std::string roid; + std::string tips; + }; + std::string requestId; + Data data; + std::string errorCode; + std::string errorMessage; + bool success; + std::string url; + }; + + + RecognizeFlowerResult(); + explicit RecognizeFlowerResult(const std::string &payload); + ~RecognizeFlowerResult(); + Response getResponse()const; + std::string getMessage()const; + int getCode()const; + bool getSuccess()const; + + protected: + void parse(const std::string &payload); + private: + Response response_; + std::string message_; + int code_; + bool success_; + + }; + } + } +} +#endif // !ALIBABACLOUD_VISIONAI_POC_MODEL_RECOGNIZEFLOWERRESULT_H_ \ No newline at end of file diff --git a/visionai-poc/include/alibabacloud/visionai-poc/model/RecognizeLabelRequest.h b/visionai-poc/include/alibabacloud/visionai-poc/model/RecognizeLabelRequest.h new file mode 100644 index 000000000..073a7f3d7 --- /dev/null +++ b/visionai-poc/include/alibabacloud/visionai-poc/model/RecognizeLabelRequest.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_VISIONAI_POC_MODEL_RECOGNIZELABELREQUEST_H_ +#define ALIBABACLOUD_VISIONAI_POC_MODEL_RECOGNIZELABELREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Visionai_poc + { + namespace Model + { + class ALIBABACLOUD_VISIONAI_POC_EXPORT RecognizeLabelRequest : public RpcServiceRequest + { + + public: + RecognizeLabelRequest(); + ~RecognizeLabelRequest(); + + std::string getMethod()const; + void setMethod(const std::string& method); + std::string getImageUrl()const; + void setImageUrl(const std::string& imageUrl); + std::string getUrl()const; + void setUrl(const std::string& url); + + private: + std::string method_; + std::string imageUrl_; + std::string url_; + + }; + } + } +} +#endif // !ALIBABACLOUD_VISIONAI_POC_MODEL_RECOGNIZELABELREQUEST_H_ \ No newline at end of file diff --git a/visionai-poc/include/alibabacloud/visionai-poc/model/RecognizeLabelResult.h b/visionai-poc/include/alibabacloud/visionai-poc/model/RecognizeLabelResult.h new file mode 100644 index 000000000..fc02da11e --- /dev/null +++ b/visionai-poc/include/alibabacloud/visionai-poc/model/RecognizeLabelResult.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_VISIONAI_POC_MODEL_RECOGNIZELABELRESULT_H_ +#define ALIBABACLOUD_VISIONAI_POC_MODEL_RECOGNIZELABELRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Visionai_poc + { + namespace Model + { + class ALIBABACLOUD_VISIONAI_POC_EXPORT RecognizeLabelResult : public ServiceResult + { + public: + struct Response + { + struct Data + { + struct Node + { + struct PropertiesResults + { + struct SubNode + { + std::string valueName; + int probability; + std::string valueId; + }; + std::string propertyName; + std::vector values; + std::string propertyId; + }; + PropertiesResults propertiesResults; + }; + std::vector objects; + }; + std::string requestId; + Data data; + std::string errorCode; + std::string errorMessage; + bool success; + std::string url; + }; + + + RecognizeLabelResult(); + explicit RecognizeLabelResult(const std::string &payload); + ~RecognizeLabelResult(); + Response getResponse()const; + std::string getMessage()const; + std::string getCode()const; + bool getSuccess()const; + + protected: + void parse(const std::string &payload); + private: + Response response_; + std::string message_; + std::string code_; + bool success_; + + }; + } + } +} +#endif // !ALIBABACLOUD_VISIONAI_POC_MODEL_RECOGNIZELABELRESULT_H_ \ No newline at end of file diff --git a/visionai-poc/include/alibabacloud/visionai-poc/model/RecognizePetRequest.h b/visionai-poc/include/alibabacloud/visionai-poc/model/RecognizePetRequest.h new file mode 100644 index 000000000..09b5ca506 --- /dev/null +++ b/visionai-poc/include/alibabacloud/visionai-poc/model/RecognizePetRequest.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_VISIONAI_POC_MODEL_RECOGNIZEPETREQUEST_H_ +#define ALIBABACLOUD_VISIONAI_POC_MODEL_RECOGNIZEPETREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Visionai_poc + { + namespace Model + { + class ALIBABACLOUD_VISIONAI_POC_EXPORT RecognizePetRequest : public RpcServiceRequest + { + + public: + RecognizePetRequest(); + ~RecognizePetRequest(); + + std::string getMethod()const; + void setMethod(const std::string& method); + std::string getImageUrl()const; + void setImageUrl(const std::string& imageUrl); + std::string getUrl()const; + void setUrl(const std::string& url); + + private: + std::string method_; + std::string imageUrl_; + std::string url_; + + }; + } + } +} +#endif // !ALIBABACLOUD_VISIONAI_POC_MODEL_RECOGNIZEPETREQUEST_H_ \ No newline at end of file diff --git a/visionai-poc/include/alibabacloud/visionai-poc/model/RecognizePetResult.h b/visionai-poc/include/alibabacloud/visionai-poc/model/RecognizePetResult.h new file mode 100644 index 000000000..88ad785d3 --- /dev/null +++ b/visionai-poc/include/alibabacloud/visionai-poc/model/RecognizePetResult.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_VISIONAI_POC_MODEL_RECOGNIZEPETRESULT_H_ +#define ALIBABACLOUD_VISIONAI_POC_MODEL_RECOGNIZEPETRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Visionai_poc + { + namespace Model + { + class ALIBABACLOUD_VISIONAI_POC_EXPORT RecognizePetResult : public ServiceResult + { + public: + struct Response + { + struct Data + { + struct Node + { + std::string score; + std::string tag; + }; + std::string modelName; + std::string description; + std::string sptId; + std::vector predictability; + std::string confidence; + std::string prop; + std::string external; + std::string picUrl; + std::string roid; + std::string name; + std::string tips; + std::string predictRes; + }; + std::string requestId; + Data data; + std::string errorCode; + std::string errorMessage; + bool success; + std::string url; + }; + + + RecognizePetResult(); + explicit RecognizePetResult(const std::string &payload); + ~RecognizePetResult(); + Response getResponse()const; + std::string getMessage()const; + std::string getCode()const; + bool getSuccess()const; + + protected: + void parse(const std::string &payload); + private: + Response response_; + std::string message_; + std::string code_; + bool success_; + + }; + } + } +} +#endif // !ALIBABACLOUD_VISIONAI_POC_MODEL_RECOGNIZEPETRESULT_H_ \ No newline at end of file diff --git a/visionai-poc/src/Visionai-pocClient.cc b/visionai-poc/src/Visionai-pocClient.cc new file mode 100644 index 000000000..4035bb096 --- /dev/null +++ b/visionai-poc/src/Visionai-pocClient.cc @@ -0,0 +1,305 @@ +/* + * 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::Visionai_poc; +using namespace AlibabaCloud::Visionai_poc::Model; + +namespace +{ + const std::string SERVICE_NAME = "visionai-poc"; +} + +Visionai_pocClient::Visionai_pocClient(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, ""); +} + +Visionai_pocClient::Visionai_pocClient(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, ""); +} + +Visionai_pocClient::Visionai_pocClient(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, ""); +} + +Visionai_pocClient::~Visionai_pocClient() +{} + +Visionai_pocClient::CheckMultiagentOutcome Visionai_pocClient::checkMultiagent(const CheckMultiagentRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return CheckMultiagentOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return CheckMultiagentOutcome(CheckMultiagentResult(outcome.result())); + else + return CheckMultiagentOutcome(outcome.error()); +} + +void Visionai_pocClient::checkMultiagentAsync(const CheckMultiagentRequest& request, const CheckMultiagentAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, checkMultiagent(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +Visionai_pocClient::CheckMultiagentOutcomeCallable Visionai_pocClient::checkMultiagentCallable(const CheckMultiagentRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->checkMultiagent(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +Visionai_pocClient::PredictCategoryOutcome Visionai_pocClient::predictCategory(const PredictCategoryRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return PredictCategoryOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return PredictCategoryOutcome(PredictCategoryResult(outcome.result())); + else + return PredictCategoryOutcome(outcome.error()); +} + +void Visionai_pocClient::predictCategoryAsync(const PredictCategoryRequest& request, const PredictCategoryAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, predictCategory(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +Visionai_pocClient::PredictCategoryOutcomeCallable Visionai_pocClient::predictCategoryCallable(const PredictCategoryRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->predictCategory(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +Visionai_pocClient::RecognizeCarOutcome Visionai_pocClient::recognizeCar(const RecognizeCarRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return RecognizeCarOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return RecognizeCarOutcome(RecognizeCarResult(outcome.result())); + else + return RecognizeCarOutcome(outcome.error()); +} + +void Visionai_pocClient::recognizeCarAsync(const RecognizeCarRequest& request, const RecognizeCarAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, recognizeCar(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +Visionai_pocClient::RecognizeCarOutcomeCallable Visionai_pocClient::recognizeCarCallable(const RecognizeCarRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->recognizeCar(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +Visionai_pocClient::RecognizeEntityOutcome Visionai_pocClient::recognizeEntity(const RecognizeEntityRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return RecognizeEntityOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return RecognizeEntityOutcome(RecognizeEntityResult(outcome.result())); + else + return RecognizeEntityOutcome(outcome.error()); +} + +void Visionai_pocClient::recognizeEntityAsync(const RecognizeEntityRequest& request, const RecognizeEntityAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, recognizeEntity(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +Visionai_pocClient::RecognizeEntityOutcomeCallable Visionai_pocClient::recognizeEntityCallable(const RecognizeEntityRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->recognizeEntity(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +Visionai_pocClient::RecognizeFlowerOutcome Visionai_pocClient::recognizeFlower(const RecognizeFlowerRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return RecognizeFlowerOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return RecognizeFlowerOutcome(RecognizeFlowerResult(outcome.result())); + else + return RecognizeFlowerOutcome(outcome.error()); +} + +void Visionai_pocClient::recognizeFlowerAsync(const RecognizeFlowerRequest& request, const RecognizeFlowerAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, recognizeFlower(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +Visionai_pocClient::RecognizeFlowerOutcomeCallable Visionai_pocClient::recognizeFlowerCallable(const RecognizeFlowerRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->recognizeFlower(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +Visionai_pocClient::RecognizeLabelOutcome Visionai_pocClient::recognizeLabel(const RecognizeLabelRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return RecognizeLabelOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return RecognizeLabelOutcome(RecognizeLabelResult(outcome.result())); + else + return RecognizeLabelOutcome(outcome.error()); +} + +void Visionai_pocClient::recognizeLabelAsync(const RecognizeLabelRequest& request, const RecognizeLabelAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, recognizeLabel(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +Visionai_pocClient::RecognizeLabelOutcomeCallable Visionai_pocClient::recognizeLabelCallable(const RecognizeLabelRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->recognizeLabel(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +Visionai_pocClient::RecognizePetOutcome Visionai_pocClient::recognizePet(const RecognizePetRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return RecognizePetOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return RecognizePetOutcome(RecognizePetResult(outcome.result())); + else + return RecognizePetOutcome(outcome.error()); +} + +void Visionai_pocClient::recognizePetAsync(const RecognizePetRequest& request, const RecognizePetAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, recognizePet(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +Visionai_pocClient::RecognizePetOutcomeCallable Visionai_pocClient::recognizePetCallable(const RecognizePetRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->recognizePet(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + diff --git a/visionai-poc/src/model/CheckMultiagentRequest.cc b/visionai-poc/src/model/CheckMultiagentRequest.cc new file mode 100644 index 000000000..8a6a06c0d --- /dev/null +++ b/visionai-poc/src/model/CheckMultiagentRequest.cc @@ -0,0 +1,62 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +using AlibabaCloud::Visionai_poc::Model::CheckMultiagentRequest; + +CheckMultiagentRequest::CheckMultiagentRequest() : + RpcServiceRequest("visionai-poc", "2020-04-08", "CheckMultiagent") +{ + setMethod(HttpRequest::Method::Post); +} + +CheckMultiagentRequest::~CheckMultiagentRequest() +{} + +std::string CheckMultiagentRequest::getMethod()const +{ + return method_; +} + +void CheckMultiagentRequest::setMethod(const std::string& method) +{ + method_ = method; + setBodyParameter("Method", method); +} + +std::string CheckMultiagentRequest::getImageUrl()const +{ + return imageUrl_; +} + +void CheckMultiagentRequest::setImageUrl(const std::string& imageUrl) +{ + imageUrl_ = imageUrl; + setBodyParameter("ImageUrl", imageUrl); +} + +std::string CheckMultiagentRequest::getUrl()const +{ + return url_; +} + +void CheckMultiagentRequest::setUrl(const std::string& url) +{ + url_ = url; + setBodyParameter("Url", url); +} + diff --git a/visionai-poc/src/model/CheckMultiagentResult.cc b/visionai-poc/src/model/CheckMultiagentResult.cc new file mode 100644 index 000000000..343068e69 --- /dev/null +++ b/visionai-poc/src/model/CheckMultiagentResult.cc @@ -0,0 +1,83 @@ +/* + * 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::Visionai_poc; +using namespace AlibabaCloud::Visionai_poc::Model; + +CheckMultiagentResult::CheckMultiagentResult() : + ServiceResult() +{} + +CheckMultiagentResult::CheckMultiagentResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +CheckMultiagentResult::~CheckMultiagentResult() +{} + +void CheckMultiagentResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto responseNode = value["Response"]; + if(!responseNode["Data"].isNull()) + response_.data = responseNode["Data"].asString(); + if(!responseNode["Success"].isNull()) + response_.success = responseNode["Success"].asString() == "true"; + if(!responseNode["Url"].isNull()) + response_.url = responseNode["Url"].asString(); + if(!responseNode["RequestId"].isNull()) + response_.requestId = responseNode["RequestId"].asString(); + if(!responseNode["ErrorCode"].isNull()) + response_.errorCode = responseNode["ErrorCode"].asString(); + if(!responseNode["ErrorMessage"].isNull()) + response_.errorMessage = responseNode["ErrorMessage"].asString(); + if(!value["Code"].isNull()) + code_ = value["Code"].asString(); + if(!value["Success"].isNull()) + success_ = value["Success"].asString() == "true"; + if(!value["Message"].isNull()) + message_ = value["Message"].asString(); + +} + +CheckMultiagentResult::Response CheckMultiagentResult::getResponse()const +{ + return response_; +} + +std::string CheckMultiagentResult::getMessage()const +{ + return message_; +} + +std::string CheckMultiagentResult::getCode()const +{ + return code_; +} + +bool CheckMultiagentResult::getSuccess()const +{ + return success_; +} + diff --git a/visionai-poc/src/model/PredictCategoryRequest.cc b/visionai-poc/src/model/PredictCategoryRequest.cc new file mode 100644 index 000000000..ae38e6c43 --- /dev/null +++ b/visionai-poc/src/model/PredictCategoryRequest.cc @@ -0,0 +1,73 @@ +/* + * 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::Visionai_poc::Model::PredictCategoryRequest; + +PredictCategoryRequest::PredictCategoryRequest() : + RpcServiceRequest("visionai-poc", "2020-04-08", "PredictCategory") +{ + setMethod(HttpRequest::Method::Post); +} + +PredictCategoryRequest::~PredictCategoryRequest() +{} + +std::string PredictCategoryRequest::getMethod()const +{ + return method_; +} + +void PredictCategoryRequest::setMethod(const std::string& method) +{ + method_ = method; + setBodyParameter("Method", method); +} + +std::string PredictCategoryRequest::getImageUrl()const +{ + return imageUrl_; +} + +void PredictCategoryRequest::setImageUrl(const std::string& imageUrl) +{ + imageUrl_ = imageUrl; + setBodyParameter("ImageUrl", imageUrl); +} + +std::string PredictCategoryRequest::getTitle()const +{ + return title_; +} + +void PredictCategoryRequest::setTitle(const std::string& title) +{ + title_ = title; + setBodyParameter("Title", title); +} + +std::string PredictCategoryRequest::getUrl()const +{ + return url_; +} + +void PredictCategoryRequest::setUrl(const std::string& url) +{ + url_ = url; + setBodyParameter("Url", url); +} + diff --git a/visionai-poc/src/model/PredictCategoryResult.cc b/visionai-poc/src/model/PredictCategoryResult.cc new file mode 100644 index 000000000..1143c1b6b --- /dev/null +++ b/visionai-poc/src/model/PredictCategoryResult.cc @@ -0,0 +1,118 @@ +/* + * 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::Visionai_poc; +using namespace AlibabaCloud::Visionai_poc::Model; + +PredictCategoryResult::PredictCategoryResult() : + ServiceResult() +{} + +PredictCategoryResult::PredictCategoryResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +PredictCategoryResult::~PredictCategoryResult() +{} + +void PredictCategoryResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto responseNode = value["Response"]; + if(!responseNode["Success"].isNull()) + response_.success = responseNode["Success"].asString() == "true"; + if(!responseNode["Url"].isNull()) + response_.url = responseNode["Url"].asString(); + if(!responseNode["RequestId"].isNull()) + response_.requestId = responseNode["RequestId"].asString(); + if(!responseNode["ErrorCode"].isNull()) + response_.errorCode = responseNode["ErrorCode"].asString(); + if(!responseNode["ErrorMessage"].isNull()) + response_.errorMessage = responseNode["ErrorMessage"].asString(); + auto allDataNode = responseNode["Data"]["Node"]; + for (auto responseNodeDataNode : allDataNode) + { + Response::Node nodeObject; + if(!responseNodeDataNode["CateId"].isNull()) + nodeObject.cateId = responseNodeDataNode["CateId"].asString(); + auto categoryNode = value["Category"]; + if(!categoryNode["CateLevelFOURName"].isNull()) + nodeObject.category.cateLevelFOURName = categoryNode["CateLevelFOURName"].asString(); + if(!categoryNode["CateLevelTwoId"].isNull()) + nodeObject.category.cateLevelTwoId = std::stoi(categoryNode["CateLevelTwoId"].asString()); + if(!categoryNode["CateLevelOneId"].isNull()) + nodeObject.category.cateLevelOneId = std::stoi(categoryNode["CateLevelOneId"].asString()); + if(!categoryNode["CateLevelOneName"].isNull()) + nodeObject.category.cateLevelOneName = categoryNode["CateLevelOneName"].asString(); + if(!categoryNode["CateLevelFourId"].isNull()) + nodeObject.category.cateLevelFourId = std::stoi(categoryNode["CateLevelFourId"].asString()); + if(!categoryNode["CateLevel"].isNull()) + nodeObject.category.cateLevel = std::stoi(categoryNode["CateLevel"].asString()); + if(!categoryNode["CateLevelThreeId"].isNull()) + nodeObject.category.cateLevelThreeId = std::stoi(categoryNode["CateLevelThreeId"].asString()); + if(!categoryNode["CateLevelFiveId"].isNull()) + nodeObject.category.cateLevelFiveId = std::stoi(categoryNode["CateLevelFiveId"].asString()); + if(!categoryNode["CateLevelFiveName"].isNull()) + nodeObject.category.cateLevelFiveName = categoryNode["CateLevelFiveName"].asString(); + if(!categoryNode["CateName"].isNull()) + nodeObject.category.cateName = categoryNode["CateName"].asString(); + if(!categoryNode["CateLevelTwoName"].isNull()) + nodeObject.category.cateLevelTwoName = categoryNode["CateLevelTwoName"].asString(); + if(!categoryNode["Score"].isNull()) + nodeObject.category.score = std::stof(categoryNode["Score"].asString()); + if(!categoryNode["CateId"].isNull()) + nodeObject.category.cateId = std::stoi(categoryNode["CateId"].asString()); + if(!categoryNode["CateLevelThreeName"].isNull()) + nodeObject.category.cateLevelThreeName = categoryNode["CateLevelThreeName"].asString(); + response_.data.push_back(nodeObject); + } + if(!value["Code"].isNull()) + code_ = std::stoi(value["Code"].asString()); + if(!value["Message"].isNull()) + message_ = value["Message"].asString(); + if(!value["Success"].isNull()) + success_ = value["Success"].asString() == "true"; + +} + +PredictCategoryResult::Response PredictCategoryResult::getResponse()const +{ + return response_; +} + +std::string PredictCategoryResult::getMessage()const +{ + return message_; +} + +int PredictCategoryResult::getCode()const +{ + return code_; +} + +bool PredictCategoryResult::getSuccess()const +{ + return success_; +} + diff --git a/visionai-poc/src/model/RecognizeCarRequest.cc b/visionai-poc/src/model/RecognizeCarRequest.cc new file mode 100644 index 000000000..20adbd672 --- /dev/null +++ b/visionai-poc/src/model/RecognizeCarRequest.cc @@ -0,0 +1,62 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +using AlibabaCloud::Visionai_poc::Model::RecognizeCarRequest; + +RecognizeCarRequest::RecognizeCarRequest() : + RpcServiceRequest("visionai-poc", "2020-04-08", "RecognizeCar") +{ + setMethod(HttpRequest::Method::Post); +} + +RecognizeCarRequest::~RecognizeCarRequest() +{} + +std::string RecognizeCarRequest::getMethod()const +{ + return method_; +} + +void RecognizeCarRequest::setMethod(const std::string& method) +{ + method_ = method; + setBodyParameter("Method", method); +} + +std::string RecognizeCarRequest::getImageUrl()const +{ + return imageUrl_; +} + +void RecognizeCarRequest::setImageUrl(const std::string& imageUrl) +{ + imageUrl_ = imageUrl; + setBodyParameter("ImageUrl", imageUrl); +} + +std::string RecognizeCarRequest::getUrl()const +{ + return url_; +} + +void RecognizeCarRequest::setUrl(const std::string& url) +{ + url_ = url; + setBodyParameter("Url", url); +} + diff --git a/visionai-poc/src/model/RecognizeCarResult.cc b/visionai-poc/src/model/RecognizeCarResult.cc new file mode 100644 index 000000000..78950bf95 --- /dev/null +++ b/visionai-poc/src/model/RecognizeCarResult.cc @@ -0,0 +1,104 @@ +/* + * 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::Visionai_poc; +using namespace AlibabaCloud::Visionai_poc::Model; + +RecognizeCarResult::RecognizeCarResult() : + ServiceResult() +{} + +RecognizeCarResult::RecognizeCarResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +RecognizeCarResult::~RecognizeCarResult() +{} + +void RecognizeCarResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto responseNode = value["Response"]; + if(!responseNode["Success"].isNull()) + response_.success = responseNode["Success"].asString() == "true"; + if(!responseNode["Url"].isNull()) + response_.url = responseNode["Url"].asString(); + if(!responseNode["RequestId"].isNull()) + response_.requestId = responseNode["RequestId"].asString(); + if(!responseNode["ErrorCode"].isNull()) + response_.errorCode = responseNode["ErrorCode"].asString(); + if(!responseNode["ErrorMessage"].isNull()) + response_.errorMessage = responseNode["ErrorMessage"].asString(); + auto dataNode = responseNode["Data"]; + if(!dataNode["External"].isNull()) + response_.data.external = dataNode["External"].asString(); + if(!dataNode["ModelName"].isNull()) + response_.data.modelName = dataNode["ModelName"].asString(); + if(!dataNode["Confidence"].isNull()) + response_.data.confidence = dataNode["Confidence"].asString(); + if(!dataNode["Prop"].isNull()) + response_.data.prop = dataNode["Prop"].asString(); + if(!dataNode["Name"].isNull()) + response_.data.name = dataNode["Name"].asString(); + if(!dataNode["PicUrl"].isNull()) + response_.data.picUrl = dataNode["PicUrl"].asString(); + if(!dataNode["SptId"].isNull()) + response_.data.sptId = dataNode["SptId"].asString(); + if(!dataNode["Roid"].isNull()) + response_.data.roid = dataNode["Roid"].asString(); + if(!dataNode["Tips"].isNull()) + response_.data.tips = dataNode["Tips"].asString(); + if(!dataNode["Description"].isNull()) + response_.data.description = dataNode["Description"].asString(); + if(!dataNode["PredictRes"].isNull()) + response_.data.predictRes = dataNode["PredictRes"].asString(); + if(!value["Code"].isNull()) + code_ = std::stoi(value["Code"].asString()); + if(!value["Message"].isNull()) + message_ = value["Message"].asString(); + if(!value["Success"].isNull()) + success_ = value["Success"].asString() == "true"; + +} + +RecognizeCarResult::Response RecognizeCarResult::getResponse()const +{ + return response_; +} + +std::string RecognizeCarResult::getMessage()const +{ + return message_; +} + +int RecognizeCarResult::getCode()const +{ + return code_; +} + +bool RecognizeCarResult::getSuccess()const +{ + return success_; +} + diff --git a/visionai-poc/src/model/RecognizeEntityRequest.cc b/visionai-poc/src/model/RecognizeEntityRequest.cc new file mode 100644 index 000000000..a6a8fb16c --- /dev/null +++ b/visionai-poc/src/model/RecognizeEntityRequest.cc @@ -0,0 +1,62 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +using AlibabaCloud::Visionai_poc::Model::RecognizeEntityRequest; + +RecognizeEntityRequest::RecognizeEntityRequest() : + RpcServiceRequest("visionai-poc", "2020-04-08", "RecognizeEntity") +{ + setMethod(HttpRequest::Method::Post); +} + +RecognizeEntityRequest::~RecognizeEntityRequest() +{} + +std::string RecognizeEntityRequest::getMethod()const +{ + return method_; +} + +void RecognizeEntityRequest::setMethod(const std::string& method) +{ + method_ = method; + setBodyParameter("Method", method); +} + +std::string RecognizeEntityRequest::getImageUrl()const +{ + return imageUrl_; +} + +void RecognizeEntityRequest::setImageUrl(const std::string& imageUrl) +{ + imageUrl_ = imageUrl; + setBodyParameter("ImageUrl", imageUrl); +} + +std::string RecognizeEntityRequest::getUrl()const +{ + return url_; +} + +void RecognizeEntityRequest::setUrl(const std::string& url) +{ + url_ = url; + setBodyParameter("Url", url); +} + diff --git a/visionai-poc/src/model/RecognizeEntityResult.cc b/visionai-poc/src/model/RecognizeEntityResult.cc new file mode 100644 index 000000000..73497e17d --- /dev/null +++ b/visionai-poc/src/model/RecognizeEntityResult.cc @@ -0,0 +1,98 @@ +/* + * 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::Visionai_poc; +using namespace AlibabaCloud::Visionai_poc::Model; + +RecognizeEntityResult::RecognizeEntityResult() : + ServiceResult() +{} + +RecognizeEntityResult::RecognizeEntityResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +RecognizeEntityResult::~RecognizeEntityResult() +{} + +void RecognizeEntityResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto responseNode = value["Response"]; + if(!responseNode["Success"].isNull()) + response_.success = responseNode["Success"].asString() == "true"; + if(!responseNode["Url"].isNull()) + response_.url = responseNode["Url"].asString(); + if(!responseNode["RequestId"].isNull()) + response_.requestId = responseNode["RequestId"].asString(); + if(!responseNode["ErrorCode"].isNull()) + response_.errorCode = responseNode["ErrorCode"].asString(); + if(!responseNode["ErrorMessage"].isNull()) + response_.errorMessage = responseNode["ErrorMessage"].asString(); + auto dataNode = responseNode["Data"]; + if(!dataNode["CallSubModelApi"].isNull()) + response_.data.callSubModelApi = std::stoi(dataNode["CallSubModelApi"].asString()); + if(!dataNode["RequestId"].isNull()) + response_.data.requestId = dataNode["RequestId"].asString(); + if(!dataNode["UseSubModelResult"].isNull()) + response_.data.useSubModelResult = std::stoi(dataNode["UseSubModelResult"].asString()); + auto allResultNode = dataNode["Result"]["Node"]; + for (auto dataNodeResultNode : allResultNode) + { + Response::Data::Node nodeObject; + if(!dataNodeResultNode["Score"].isNull()) + nodeObject.score = dataNodeResultNode["Score"].asString(); + if(!dataNodeResultNode["Tag"].isNull()) + nodeObject.tag = dataNodeResultNode["Tag"].asString(); + response_.data.result.push_back(nodeObject); + } + if(!value["Code"].isNull()) + code_ = std::stoi(value["Code"].asString()); + if(!value["Message"].isNull()) + message_ = value["Message"].asString(); + if(!value["Success"].isNull()) + success_ = value["Success"].asString() == "true"; + +} + +RecognizeEntityResult::Response RecognizeEntityResult::getResponse()const +{ + return response_; +} + +std::string RecognizeEntityResult::getMessage()const +{ + return message_; +} + +int RecognizeEntityResult::getCode()const +{ + return code_; +} + +bool RecognizeEntityResult::getSuccess()const +{ + return success_; +} + diff --git a/visionai-poc/src/model/RecognizeFlowerRequest.cc b/visionai-poc/src/model/RecognizeFlowerRequest.cc new file mode 100644 index 000000000..c7622ce1b --- /dev/null +++ b/visionai-poc/src/model/RecognizeFlowerRequest.cc @@ -0,0 +1,62 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +using AlibabaCloud::Visionai_poc::Model::RecognizeFlowerRequest; + +RecognizeFlowerRequest::RecognizeFlowerRequest() : + RpcServiceRequest("visionai-poc", "2020-04-08", "RecognizeFlower") +{ + setMethod(HttpRequest::Method::Post); +} + +RecognizeFlowerRequest::~RecognizeFlowerRequest() +{} + +std::string RecognizeFlowerRequest::getMethod()const +{ + return method_; +} + +void RecognizeFlowerRequest::setMethod(const std::string& method) +{ + method_ = method; + setBodyParameter("Method", method); +} + +std::string RecognizeFlowerRequest::getImageUrl()const +{ + return imageUrl_; +} + +void RecognizeFlowerRequest::setImageUrl(const std::string& imageUrl) +{ + imageUrl_ = imageUrl; + setBodyParameter("ImageUrl", imageUrl); +} + +std::string RecognizeFlowerRequest::getUrl()const +{ + return url_; +} + +void RecognizeFlowerRequest::setUrl(const std::string& url) +{ + url_ = url; + setBodyParameter("Url", url); +} + diff --git a/visionai-poc/src/model/RecognizeFlowerResult.cc b/visionai-poc/src/model/RecognizeFlowerResult.cc new file mode 100644 index 000000000..ad925e244 --- /dev/null +++ b/visionai-poc/src/model/RecognizeFlowerResult.cc @@ -0,0 +1,116 @@ +/* + * 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::Visionai_poc; +using namespace AlibabaCloud::Visionai_poc::Model; + +RecognizeFlowerResult::RecognizeFlowerResult() : + ServiceResult() +{} + +RecognizeFlowerResult::RecognizeFlowerResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +RecognizeFlowerResult::~RecognizeFlowerResult() +{} + +void RecognizeFlowerResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto responseNode = value["Response"]; + if(!responseNode["Success"].isNull()) + response_.success = responseNode["Success"].asString() == "true"; + if(!responseNode["Url"].isNull()) + response_.url = responseNode["Url"].asString(); + if(!responseNode["RequestId"].isNull()) + response_.requestId = responseNode["RequestId"].asString(); + if(!responseNode["ErrorCode"].isNull()) + response_.errorCode = responseNode["ErrorCode"].asString(); + if(!responseNode["ErrorMessage"].isNull()) + response_.errorMessage = responseNode["ErrorMessage"].asString(); + auto dataNode = responseNode["Data"]; + if(!dataNode["External"].isNull()) + response_.data.external = dataNode["External"].asString(); + if(!dataNode["Confidence"].isNull()) + response_.data.confidence = dataNode["Confidence"].asString(); + if(!dataNode["Roid"].isNull()) + response_.data.roid = dataNode["Roid"].asString(); + if(!dataNode["Version"].isNull()) + response_.data.version = dataNode["Version"].asString(); + if(!dataNode["Tips"].isNull()) + response_.data.tips = dataNode["Tips"].asString(); + if(!dataNode["ModelName"].isNull()) + response_.data.modelName = dataNode["ModelName"].asString(); + if(!dataNode["Prop"].isNull()) + response_.data.prop = dataNode["Prop"].asString(); + if(!dataNode["Name"].isNull()) + response_.data.name = dataNode["Name"].asString(); + if(!dataNode["PicUrl"].isNull()) + response_.data.picUrl = dataNode["PicUrl"].asString(); + if(!dataNode["SptId"].isNull()) + response_.data.sptId = dataNode["SptId"].asString(); + if(!dataNode["Description"].isNull()) + response_.data.description = dataNode["Description"].asString(); + if(!dataNode["PredictRes"].isNull()) + response_.data.predictRes = dataNode["PredictRes"].asString(); + auto allPredictabilityNode = dataNode["Predictability"]["Node"]; + for (auto dataNodePredictabilityNode : allPredictabilityNode) + { + Response::Data::Node nodeObject; + if(!dataNodePredictabilityNode["Score"].isNull()) + nodeObject.score = dataNodePredictabilityNode["Score"].asString(); + if(!dataNodePredictabilityNode["Tag"].isNull()) + nodeObject.tag = dataNodePredictabilityNode["Tag"].asString(); + response_.data.predictability.push_back(nodeObject); + } + if(!value["Code"].isNull()) + code_ = std::stoi(value["Code"].asString()); + if(!value["Message"].isNull()) + message_ = value["Message"].asString(); + if(!value["Success"].isNull()) + success_ = value["Success"].asString() == "true"; + +} + +RecognizeFlowerResult::Response RecognizeFlowerResult::getResponse()const +{ + return response_; +} + +std::string RecognizeFlowerResult::getMessage()const +{ + return message_; +} + +int RecognizeFlowerResult::getCode()const +{ + return code_; +} + +bool RecognizeFlowerResult::getSuccess()const +{ + return success_; +} + diff --git a/visionai-poc/src/model/RecognizeLabelRequest.cc b/visionai-poc/src/model/RecognizeLabelRequest.cc new file mode 100644 index 000000000..0466edd79 --- /dev/null +++ b/visionai-poc/src/model/RecognizeLabelRequest.cc @@ -0,0 +1,62 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +using AlibabaCloud::Visionai_poc::Model::RecognizeLabelRequest; + +RecognizeLabelRequest::RecognizeLabelRequest() : + RpcServiceRequest("visionai-poc", "2020-04-08", "RecognizeLabel") +{ + setMethod(HttpRequest::Method::Post); +} + +RecognizeLabelRequest::~RecognizeLabelRequest() +{} + +std::string RecognizeLabelRequest::getMethod()const +{ + return method_; +} + +void RecognizeLabelRequest::setMethod(const std::string& method) +{ + method_ = method; + setBodyParameter("Method", method); +} + +std::string RecognizeLabelRequest::getImageUrl()const +{ + return imageUrl_; +} + +void RecognizeLabelRequest::setImageUrl(const std::string& imageUrl) +{ + imageUrl_ = imageUrl; + setBodyParameter("ImageUrl", imageUrl); +} + +std::string RecognizeLabelRequest::getUrl()const +{ + return url_; +} + +void RecognizeLabelRequest::setUrl(const std::string& url) +{ + url_ = url; + setBodyParameter("Url", url); +} + diff --git a/visionai-poc/src/model/RecognizeLabelResult.cc b/visionai-poc/src/model/RecognizeLabelResult.cc new file mode 100644 index 000000000..093da5db9 --- /dev/null +++ b/visionai-poc/src/model/RecognizeLabelResult.cc @@ -0,0 +1,105 @@ +/* + * 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::Visionai_poc; +using namespace AlibabaCloud::Visionai_poc::Model; + +RecognizeLabelResult::RecognizeLabelResult() : + ServiceResult() +{} + +RecognizeLabelResult::RecognizeLabelResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +RecognizeLabelResult::~RecognizeLabelResult() +{} + +void RecognizeLabelResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto responseNode = value["Response"]; + if(!responseNode["Success"].isNull()) + response_.success = responseNode["Success"].asString() == "true"; + if(!responseNode["Url"].isNull()) + response_.url = responseNode["Url"].asString(); + if(!responseNode["RequestId"].isNull()) + response_.requestId = responseNode["RequestId"].asString(); + if(!responseNode["ErrorCode"].isNull()) + response_.errorCode = responseNode["ErrorCode"].asString(); + if(!responseNode["ErrorMessage"].isNull()) + response_.errorMessage = responseNode["ErrorMessage"].asString(); + auto dataNode = responseNode["Data"]; + auto allObjectsNode = dataNode["Objects"]["Node"]; + for (auto dataNodeObjectsNode : allObjectsNode) + { + Response::Data::Node nodeObject; + auto propertiesResultsNode = value["PropertiesResults"]; + if(!propertiesResultsNode["PropertyId"].isNull()) + nodeObject.propertiesResults.propertyId = propertiesResultsNode["PropertyId"].asString(); + if(!propertiesResultsNode["PropertyName"].isNull()) + nodeObject.propertiesResults.propertyName = propertiesResultsNode["PropertyName"].asString(); + auto allValuesNode = propertiesResultsNode["Values"]["SubNode"]; + for (auto propertiesResultsNodeValuesSubNode : allValuesNode) + { + Response::Data::Node::PropertiesResults::SubNode subNodeObject; + if(!propertiesResultsNodeValuesSubNode["Probability"].isNull()) + subNodeObject.probability = std::stoi(propertiesResultsNodeValuesSubNode["Probability"].asString()); + if(!propertiesResultsNodeValuesSubNode["ValueId"].isNull()) + subNodeObject.valueId = propertiesResultsNodeValuesSubNode["ValueId"].asString(); + if(!propertiesResultsNodeValuesSubNode["ValueName"].isNull()) + subNodeObject.valueName = propertiesResultsNodeValuesSubNode["ValueName"].asString(); + nodeObject.propertiesResults.values.push_back(subNodeObject); + } + response_.data.objects.push_back(nodeObject); + } + if(!value["Code"].isNull()) + code_ = value["Code"].asString(); + if(!value["Success"].isNull()) + success_ = value["Success"].asString() == "true"; + if(!value["Message"].isNull()) + message_ = value["Message"].asString(); + +} + +RecognizeLabelResult::Response RecognizeLabelResult::getResponse()const +{ + return response_; +} + +std::string RecognizeLabelResult::getMessage()const +{ + return message_; +} + +std::string RecognizeLabelResult::getCode()const +{ + return code_; +} + +bool RecognizeLabelResult::getSuccess()const +{ + return success_; +} + diff --git a/visionai-poc/src/model/RecognizePetRequest.cc b/visionai-poc/src/model/RecognizePetRequest.cc new file mode 100644 index 000000000..fa396efe6 --- /dev/null +++ b/visionai-poc/src/model/RecognizePetRequest.cc @@ -0,0 +1,62 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +using AlibabaCloud::Visionai_poc::Model::RecognizePetRequest; + +RecognizePetRequest::RecognizePetRequest() : + RpcServiceRequest("visionai-poc", "2020-04-08", "RecognizePet") +{ + setMethod(HttpRequest::Method::Post); +} + +RecognizePetRequest::~RecognizePetRequest() +{} + +std::string RecognizePetRequest::getMethod()const +{ + return method_; +} + +void RecognizePetRequest::setMethod(const std::string& method) +{ + method_ = method; + setBodyParameter("Method", method); +} + +std::string RecognizePetRequest::getImageUrl()const +{ + return imageUrl_; +} + +void RecognizePetRequest::setImageUrl(const std::string& imageUrl) +{ + imageUrl_ = imageUrl; + setBodyParameter("ImageUrl", imageUrl); +} + +std::string RecognizePetRequest::getUrl()const +{ + return url_; +} + +void RecognizePetRequest::setUrl(const std::string& url) +{ + url_ = url; + setBodyParameter("Url", url); +} + diff --git a/visionai-poc/src/model/RecognizePetResult.cc b/visionai-poc/src/model/RecognizePetResult.cc new file mode 100644 index 000000000..5aee66517 --- /dev/null +++ b/visionai-poc/src/model/RecognizePetResult.cc @@ -0,0 +1,114 @@ +/* + * 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::Visionai_poc; +using namespace AlibabaCloud::Visionai_poc::Model; + +RecognizePetResult::RecognizePetResult() : + ServiceResult() +{} + +RecognizePetResult::RecognizePetResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +RecognizePetResult::~RecognizePetResult() +{} + +void RecognizePetResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto responseNode = value["Response"]; + if(!responseNode["Success"].isNull()) + response_.success = responseNode["Success"].asString() == "true"; + if(!responseNode["Url"].isNull()) + response_.url = responseNode["Url"].asString(); + if(!responseNode["RequestId"].isNull()) + response_.requestId = responseNode["RequestId"].asString(); + if(!responseNode["ErrorCode"].isNull()) + response_.errorCode = responseNode["ErrorCode"].asString(); + if(!responseNode["ErrorMessage"].isNull()) + response_.errorMessage = responseNode["ErrorMessage"].asString(); + auto dataNode = responseNode["Data"]; + if(!dataNode["External"].isNull()) + response_.data.external = dataNode["External"].asString(); + if(!dataNode["ModelName"].isNull()) + response_.data.modelName = dataNode["ModelName"].asString(); + if(!dataNode["Confidence"].isNull()) + response_.data.confidence = dataNode["Confidence"].asString(); + if(!dataNode["Prop"].isNull()) + response_.data.prop = dataNode["Prop"].asString(); + if(!dataNode["Name"].isNull()) + response_.data.name = dataNode["Name"].asString(); + if(!dataNode["PicUrl"].isNull()) + response_.data.picUrl = dataNode["PicUrl"].asString(); + if(!dataNode["SptId"].isNull()) + response_.data.sptId = dataNode["SptId"].asString(); + if(!dataNode["Roid"].isNull()) + response_.data.roid = dataNode["Roid"].asString(); + if(!dataNode["Tips"].isNull()) + response_.data.tips = dataNode["Tips"].asString(); + if(!dataNode["Description"].isNull()) + response_.data.description = dataNode["Description"].asString(); + if(!dataNode["PredictRes"].isNull()) + response_.data.predictRes = dataNode["PredictRes"].asString(); + auto allPredictabilityNode = dataNode["Predictability"]["Node"]; + for (auto dataNodePredictabilityNode : allPredictabilityNode) + { + Response::Data::Node nodeObject; + if(!dataNodePredictabilityNode["Score"].isNull()) + nodeObject.score = dataNodePredictabilityNode["Score"].asString(); + if(!dataNodePredictabilityNode["Tag"].isNull()) + nodeObject.tag = dataNodePredictabilityNode["Tag"].asString(); + response_.data.predictability.push_back(nodeObject); + } + if(!value["Code"].isNull()) + code_ = value["Code"].asString(); + if(!value["Success"].isNull()) + success_ = value["Success"].asString() == "true"; + if(!value["Message"].isNull()) + message_ = value["Message"].asString(); + +} + +RecognizePetResult::Response RecognizePetResult::getResponse()const +{ + return response_; +} + +std::string RecognizePetResult::getMessage()const +{ + return message_; +} + +std::string RecognizePetResult::getCode()const +{ + return code_; +} + +bool RecognizePetResult::getSuccess()const +{ + return success_; +} +