diff --git a/CHANGELOG b/CHANGELOG index 0661d6c06..55b639995 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2020-08-08 Version: 1.36.562 +- Update SearchImage. + 2020-08-07 Version: 1.36.561 - GetTitleDiagnose GetTitleGenerate GetImageTranslate supported. diff --git a/VERSION b/VERSION index ad78e14ef..09aee653c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.561 \ No newline at end of file +1.36.562 \ No newline at end of file diff --git a/imgsearch/CMakeLists.txt b/imgsearch/CMakeLists.txt new file mode 100644 index 000000000..a74860406 --- /dev/null +++ b/imgsearch/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(imgsearch_public_header + include/alibabacloud/imgsearch/ImgsearchClient.h + include/alibabacloud/imgsearch/ImgsearchExport.h ) + +set(imgsearch_public_header_model + include/alibabacloud/imgsearch/model/AddImageRequest.h + include/alibabacloud/imgsearch/model/AddImageResult.h + include/alibabacloud/imgsearch/model/CreateImageDbRequest.h + include/alibabacloud/imgsearch/model/CreateImageDbResult.h + include/alibabacloud/imgsearch/model/DeleteImageRequest.h + include/alibabacloud/imgsearch/model/DeleteImageResult.h + include/alibabacloud/imgsearch/model/DeleteImageDbRequest.h + include/alibabacloud/imgsearch/model/DeleteImageDbResult.h + include/alibabacloud/imgsearch/model/ListImageDbsRequest.h + include/alibabacloud/imgsearch/model/ListImageDbsResult.h + include/alibabacloud/imgsearch/model/ListImagesRequest.h + include/alibabacloud/imgsearch/model/ListImagesResult.h + include/alibabacloud/imgsearch/model/SearchImageRequest.h + include/alibabacloud/imgsearch/model/SearchImageResult.h ) + +set(imgsearch_src + src/ImgsearchClient.cc + src/model/AddImageRequest.cc + src/model/AddImageResult.cc + src/model/CreateImageDbRequest.cc + src/model/CreateImageDbResult.cc + src/model/DeleteImageRequest.cc + src/model/DeleteImageResult.cc + src/model/DeleteImageDbRequest.cc + src/model/DeleteImageDbResult.cc + src/model/ListImageDbsRequest.cc + src/model/ListImageDbsResult.cc + src/model/ListImagesRequest.cc + src/model/ListImagesResult.cc + src/model/SearchImageRequest.cc + src/model/SearchImageResult.cc ) + +add_library(imgsearch ${LIB_TYPE} + ${imgsearch_public_header} + ${imgsearch_public_header_model} + ${imgsearch_src}) + +set_target_properties(imgsearch + 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}imgsearch + ) + +if(${LIB_TYPE} STREQUAL "SHARED") + set_target_properties(imgsearch + PROPERTIES + DEFINE_SYMBOL ALIBABACLOUD_IMGSEARCH_LIBRARY) +endif() + +target_include_directories(imgsearch + PRIVATE include + ${CMAKE_SOURCE_DIR}/core/include + ) +target_link_libraries(imgsearch + core) + +if(CMAKE_HOST_WIN32) + ExternalProject_Get_Property(jsoncpp INSTALL_DIR) + set(jsoncpp_install_dir ${INSTALL_DIR}) + add_dependencies(imgsearch + jsoncpp) + target_include_directories(imgsearch + PRIVATE ${jsoncpp_install_dir}/include) + target_link_libraries(imgsearch + ${jsoncpp_install_dir}/lib/jsoncpp.lib) + set_target_properties(imgsearch + PROPERTIES + COMPILE_OPTIONS "/bigobj") +else() + target_include_directories(imgsearch + PRIVATE /usr/include/jsoncpp) + target_link_libraries(imgsearch + jsoncpp) +endif() + +install(FILES ${imgsearch_public_header} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/imgsearch) +install(FILES ${imgsearch_public_header_model} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/imgsearch/model) +install(TARGETS imgsearch + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ) \ No newline at end of file diff --git a/imgsearch/include/alibabacloud/imgsearch/ImgsearchClient.h b/imgsearch/include/alibabacloud/imgsearch/ImgsearchClient.h new file mode 100644 index 000000000..d62ace5b9 --- /dev/null +++ b/imgsearch/include/alibabacloud/imgsearch/ImgsearchClient.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_IMGSEARCH_IMGSEARCHCLIENT_H_ +#define ALIBABACLOUD_IMGSEARCH_IMGSEARCHCLIENT_H_ + +#include +#include +#include +#include +#include "ImgsearchExport.h" +#include "model/AddImageRequest.h" +#include "model/AddImageResult.h" +#include "model/CreateImageDbRequest.h" +#include "model/CreateImageDbResult.h" +#include "model/DeleteImageRequest.h" +#include "model/DeleteImageResult.h" +#include "model/DeleteImageDbRequest.h" +#include "model/DeleteImageDbResult.h" +#include "model/ListImageDbsRequest.h" +#include "model/ListImageDbsResult.h" +#include "model/ListImagesRequest.h" +#include "model/ListImagesResult.h" +#include "model/SearchImageRequest.h" +#include "model/SearchImageResult.h" + + +namespace AlibabaCloud +{ + namespace Imgsearch + { + class ALIBABACLOUD_IMGSEARCH_EXPORT ImgsearchClient : public RpcServiceClient + { + public: + typedef Outcome AddImageOutcome; + typedef std::future AddImageOutcomeCallable; + typedef std::function&)> AddImageAsyncHandler; + typedef Outcome CreateImageDbOutcome; + typedef std::future CreateImageDbOutcomeCallable; + typedef std::function&)> CreateImageDbAsyncHandler; + typedef Outcome DeleteImageOutcome; + typedef std::future DeleteImageOutcomeCallable; + typedef std::function&)> DeleteImageAsyncHandler; + typedef Outcome DeleteImageDbOutcome; + typedef std::future DeleteImageDbOutcomeCallable; + typedef std::function&)> DeleteImageDbAsyncHandler; + typedef Outcome ListImageDbsOutcome; + typedef std::future ListImageDbsOutcomeCallable; + typedef std::function&)> ListImageDbsAsyncHandler; + typedef Outcome ListImagesOutcome; + typedef std::future ListImagesOutcomeCallable; + typedef std::function&)> ListImagesAsyncHandler; + typedef Outcome SearchImageOutcome; + typedef std::future SearchImageOutcomeCallable; + typedef std::function&)> SearchImageAsyncHandler; + + ImgsearchClient(const Credentials &credentials, const ClientConfiguration &configuration); + ImgsearchClient(const std::shared_ptr &credentialsProvider, const ClientConfiguration &configuration); + ImgsearchClient(const std::string &accessKeyId, const std::string &accessKeySecret, const ClientConfiguration &configuration); + ~ImgsearchClient(); + AddImageOutcome addImage(const Model::AddImageRequest &request)const; + void addImageAsync(const Model::AddImageRequest& request, const AddImageAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + AddImageOutcomeCallable addImageCallable(const Model::AddImageRequest& request) const; + CreateImageDbOutcome createImageDb(const Model::CreateImageDbRequest &request)const; + void createImageDbAsync(const Model::CreateImageDbRequest& request, const CreateImageDbAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + CreateImageDbOutcomeCallable createImageDbCallable(const Model::CreateImageDbRequest& request) const; + DeleteImageOutcome deleteImage(const Model::DeleteImageRequest &request)const; + void deleteImageAsync(const Model::DeleteImageRequest& request, const DeleteImageAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + DeleteImageOutcomeCallable deleteImageCallable(const Model::DeleteImageRequest& request) const; + DeleteImageDbOutcome deleteImageDb(const Model::DeleteImageDbRequest &request)const; + void deleteImageDbAsync(const Model::DeleteImageDbRequest& request, const DeleteImageDbAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + DeleteImageDbOutcomeCallable deleteImageDbCallable(const Model::DeleteImageDbRequest& request) const; + ListImageDbsOutcome listImageDbs(const Model::ListImageDbsRequest &request)const; + void listImageDbsAsync(const Model::ListImageDbsRequest& request, const ListImageDbsAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + ListImageDbsOutcomeCallable listImageDbsCallable(const Model::ListImageDbsRequest& request) const; + ListImagesOutcome listImages(const Model::ListImagesRequest &request)const; + void listImagesAsync(const Model::ListImagesRequest& request, const ListImagesAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + ListImagesOutcomeCallable listImagesCallable(const Model::ListImagesRequest& request) const; + SearchImageOutcome searchImage(const Model::SearchImageRequest &request)const; + void searchImageAsync(const Model::SearchImageRequest& request, const SearchImageAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + SearchImageOutcomeCallable searchImageCallable(const Model::SearchImageRequest& request) const; + + private: + std::shared_ptr endpointProvider_; + }; + } +} + +#endif // !ALIBABACLOUD_IMGSEARCH_IMGSEARCHCLIENT_H_ diff --git a/imgsearch/include/alibabacloud/imgsearch/ImgsearchExport.h b/imgsearch/include/alibabacloud/imgsearch/ImgsearchExport.h new file mode 100644 index 000000000..5b154705f --- /dev/null +++ b/imgsearch/include/alibabacloud/imgsearch/ImgsearchExport.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_IMGSEARCH_IMGSEARCHEXPORT_H_ +#define ALIBABACLOUD_IMGSEARCH_IMGSEARCHEXPORT_H_ + +#include + +#if defined(ALIBABACLOUD_SHARED) +# if defined(ALIBABACLOUD_IMGSEARCH_LIBRARY) +# define ALIBABACLOUD_IMGSEARCH_EXPORT ALIBABACLOUD_DECL_EXPORT +# else +# define ALIBABACLOUD_IMGSEARCH_EXPORT ALIBABACLOUD_DECL_IMPORT +# endif +#else +# define ALIBABACLOUD_IMGSEARCH_EXPORT +#endif + +#endif // !ALIBABACLOUD_IMGSEARCH_IMGSEARCHEXPORT_H_ \ No newline at end of file diff --git a/imgsearch/include/alibabacloud/imgsearch/model/AddImageRequest.h b/imgsearch/include/alibabacloud/imgsearch/model/AddImageRequest.h new file mode 100644 index 000000000..fecfc6219 --- /dev/null +++ b/imgsearch/include/alibabacloud/imgsearch/model/AddImageRequest.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_IMGSEARCH_MODEL_ADDIMAGEREQUEST_H_ +#define ALIBABACLOUD_IMGSEARCH_MODEL_ADDIMAGEREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Imgsearch + { + namespace Model + { + class ALIBABACLOUD_IMGSEARCH_EXPORT AddImageRequest : public RpcServiceRequest + { + + public: + AddImageRequest(); + ~AddImageRequest(); + + std::string getEntityId()const; + void setEntityId(const std::string& entityId); + std::string getDbName()const; + void setDbName(const std::string& dbName); + std::string getImageUrl()const; + void setImageUrl(const std::string& imageUrl); + std::string getExtraData()const; + void setExtraData(const std::string& extraData); + + private: + std::string entityId_; + std::string dbName_; + std::string imageUrl_; + std::string extraData_; + + }; + } + } +} +#endif // !ALIBABACLOUD_IMGSEARCH_MODEL_ADDIMAGEREQUEST_H_ \ No newline at end of file diff --git a/imgsearch/include/alibabacloud/imgsearch/model/AddImageResult.h b/imgsearch/include/alibabacloud/imgsearch/model/AddImageResult.h new file mode 100644 index 000000000..a7ee954b6 --- /dev/null +++ b/imgsearch/include/alibabacloud/imgsearch/model/AddImageResult.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_IMGSEARCH_MODEL_ADDIMAGERESULT_H_ +#define ALIBABACLOUD_IMGSEARCH_MODEL_ADDIMAGERESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Imgsearch + { + namespace Model + { + class ALIBABACLOUD_IMGSEARCH_EXPORT AddImageResult : public ServiceResult + { + public: + struct Data + { + std::string dataId; + }; + + + AddImageResult(); + explicit AddImageResult(const std::string &payload); + ~AddImageResult(); + Data getData()const; + + protected: + void parse(const std::string &payload); + private: + Data data_; + + }; + } + } +} +#endif // !ALIBABACLOUD_IMGSEARCH_MODEL_ADDIMAGERESULT_H_ \ No newline at end of file diff --git a/imgsearch/include/alibabacloud/imgsearch/model/CreateImageDbRequest.h b/imgsearch/include/alibabacloud/imgsearch/model/CreateImageDbRequest.h new file mode 100644 index 000000000..1b3f60afa --- /dev/null +++ b/imgsearch/include/alibabacloud/imgsearch/model/CreateImageDbRequest.h @@ -0,0 +1,48 @@ +/* + * 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_IMGSEARCH_MODEL_CREATEIMAGEDBREQUEST_H_ +#define ALIBABACLOUD_IMGSEARCH_MODEL_CREATEIMAGEDBREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Imgsearch + { + namespace Model + { + class ALIBABACLOUD_IMGSEARCH_EXPORT CreateImageDbRequest : public RpcServiceRequest + { + + public: + CreateImageDbRequest(); + ~CreateImageDbRequest(); + + std::string getName()const; + void setName(const std::string& name); + + private: + std::string name_; + + }; + } + } +} +#endif // !ALIBABACLOUD_IMGSEARCH_MODEL_CREATEIMAGEDBREQUEST_H_ \ No newline at end of file diff --git a/imgsearch/include/alibabacloud/imgsearch/model/CreateImageDbResult.h b/imgsearch/include/alibabacloud/imgsearch/model/CreateImageDbResult.h new file mode 100644 index 000000000..76ffa28d0 --- /dev/null +++ b/imgsearch/include/alibabacloud/imgsearch/model/CreateImageDbResult.h @@ -0,0 +1,49 @@ +/* + * 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_IMGSEARCH_MODEL_CREATEIMAGEDBRESULT_H_ +#define ALIBABACLOUD_IMGSEARCH_MODEL_CREATEIMAGEDBRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Imgsearch + { + namespace Model + { + class ALIBABACLOUD_IMGSEARCH_EXPORT CreateImageDbResult : public ServiceResult + { + public: + + + CreateImageDbResult(); + explicit CreateImageDbResult(const std::string &payload); + ~CreateImageDbResult(); + + protected: + void parse(const std::string &payload); + private: + + }; + } + } +} +#endif // !ALIBABACLOUD_IMGSEARCH_MODEL_CREATEIMAGEDBRESULT_H_ \ No newline at end of file diff --git a/imgsearch/include/alibabacloud/imgsearch/model/DeleteImageDbRequest.h b/imgsearch/include/alibabacloud/imgsearch/model/DeleteImageDbRequest.h new file mode 100644 index 000000000..4bd2dce7e --- /dev/null +++ b/imgsearch/include/alibabacloud/imgsearch/model/DeleteImageDbRequest.h @@ -0,0 +1,48 @@ +/* + * 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_IMGSEARCH_MODEL_DELETEIMAGEDBREQUEST_H_ +#define ALIBABACLOUD_IMGSEARCH_MODEL_DELETEIMAGEDBREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Imgsearch + { + namespace Model + { + class ALIBABACLOUD_IMGSEARCH_EXPORT DeleteImageDbRequest : public RpcServiceRequest + { + + public: + DeleteImageDbRequest(); + ~DeleteImageDbRequest(); + + std::string getName()const; + void setName(const std::string& name); + + private: + std::string name_; + + }; + } + } +} +#endif // !ALIBABACLOUD_IMGSEARCH_MODEL_DELETEIMAGEDBREQUEST_H_ \ No newline at end of file diff --git a/imgsearch/include/alibabacloud/imgsearch/model/DeleteImageDbResult.h b/imgsearch/include/alibabacloud/imgsearch/model/DeleteImageDbResult.h new file mode 100644 index 000000000..d2c049069 --- /dev/null +++ b/imgsearch/include/alibabacloud/imgsearch/model/DeleteImageDbResult.h @@ -0,0 +1,49 @@ +/* + * 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_IMGSEARCH_MODEL_DELETEIMAGEDBRESULT_H_ +#define ALIBABACLOUD_IMGSEARCH_MODEL_DELETEIMAGEDBRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Imgsearch + { + namespace Model + { + class ALIBABACLOUD_IMGSEARCH_EXPORT DeleteImageDbResult : public ServiceResult + { + public: + + + DeleteImageDbResult(); + explicit DeleteImageDbResult(const std::string &payload); + ~DeleteImageDbResult(); + + protected: + void parse(const std::string &payload); + private: + + }; + } + } +} +#endif // !ALIBABACLOUD_IMGSEARCH_MODEL_DELETEIMAGEDBRESULT_H_ \ No newline at end of file diff --git a/imgsearch/include/alibabacloud/imgsearch/model/DeleteImageRequest.h b/imgsearch/include/alibabacloud/imgsearch/model/DeleteImageRequest.h new file mode 100644 index 000000000..15151a463 --- /dev/null +++ b/imgsearch/include/alibabacloud/imgsearch/model/DeleteImageRequest.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_IMGSEARCH_MODEL_DELETEIMAGEREQUEST_H_ +#define ALIBABACLOUD_IMGSEARCH_MODEL_DELETEIMAGEREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Imgsearch + { + namespace Model + { + class ALIBABACLOUD_IMGSEARCH_EXPORT DeleteImageRequest : public RpcServiceRequest + { + + public: + DeleteImageRequest(); + ~DeleteImageRequest(); + + std::string getEntityId()const; + void setEntityId(const std::string& entityId); + std::string getDbName()const; + void setDbName(const std::string& dbName); + + private: + std::string entityId_; + std::string dbName_; + + }; + } + } +} +#endif // !ALIBABACLOUD_IMGSEARCH_MODEL_DELETEIMAGEREQUEST_H_ \ No newline at end of file diff --git a/imgsearch/include/alibabacloud/imgsearch/model/DeleteImageResult.h b/imgsearch/include/alibabacloud/imgsearch/model/DeleteImageResult.h new file mode 100644 index 000000000..89b80e68f --- /dev/null +++ b/imgsearch/include/alibabacloud/imgsearch/model/DeleteImageResult.h @@ -0,0 +1,49 @@ +/* + * 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_IMGSEARCH_MODEL_DELETEIMAGERESULT_H_ +#define ALIBABACLOUD_IMGSEARCH_MODEL_DELETEIMAGERESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Imgsearch + { + namespace Model + { + class ALIBABACLOUD_IMGSEARCH_EXPORT DeleteImageResult : public ServiceResult + { + public: + + + DeleteImageResult(); + explicit DeleteImageResult(const std::string &payload); + ~DeleteImageResult(); + + protected: + void parse(const std::string &payload); + private: + + }; + } + } +} +#endif // !ALIBABACLOUD_IMGSEARCH_MODEL_DELETEIMAGERESULT_H_ \ No newline at end of file diff --git a/imgsearch/include/alibabacloud/imgsearch/model/ListImageDbsRequest.h b/imgsearch/include/alibabacloud/imgsearch/model/ListImageDbsRequest.h new file mode 100644 index 000000000..eddf76b92 --- /dev/null +++ b/imgsearch/include/alibabacloud/imgsearch/model/ListImageDbsRequest.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_IMGSEARCH_MODEL_LISTIMAGEDBSREQUEST_H_ +#define ALIBABACLOUD_IMGSEARCH_MODEL_LISTIMAGEDBSREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Imgsearch + { + namespace Model + { + class ALIBABACLOUD_IMGSEARCH_EXPORT ListImageDbsRequest : public RpcServiceRequest + { + + public: + ListImageDbsRequest(); + ~ListImageDbsRequest(); + + + private: + + }; + } + } +} +#endif // !ALIBABACLOUD_IMGSEARCH_MODEL_LISTIMAGEDBSREQUEST_H_ \ No newline at end of file diff --git a/imgsearch/include/alibabacloud/imgsearch/model/ListImageDbsResult.h b/imgsearch/include/alibabacloud/imgsearch/model/ListImageDbsResult.h new file mode 100644 index 000000000..a682799a5 --- /dev/null +++ b/imgsearch/include/alibabacloud/imgsearch/model/ListImageDbsResult.h @@ -0,0 +1,59 @@ +/* + * 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_IMGSEARCH_MODEL_LISTIMAGEDBSRESULT_H_ +#define ALIBABACLOUD_IMGSEARCH_MODEL_LISTIMAGEDBSRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Imgsearch + { + namespace Model + { + class ALIBABACLOUD_IMGSEARCH_EXPORT ListImageDbsResult : public ServiceResult + { + public: + struct Data + { + struct DbListItem + { + std::string name; + }; + std::vector dbList; + }; + + + ListImageDbsResult(); + explicit ListImageDbsResult(const std::string &payload); + ~ListImageDbsResult(); + Data getData()const; + + protected: + void parse(const std::string &payload); + private: + Data data_; + + }; + } + } +} +#endif // !ALIBABACLOUD_IMGSEARCH_MODEL_LISTIMAGEDBSRESULT_H_ \ No newline at end of file diff --git a/imgsearch/include/alibabacloud/imgsearch/model/ListImagesRequest.h b/imgsearch/include/alibabacloud/imgsearch/model/ListImagesRequest.h new file mode 100644 index 000000000..38b5b3849 --- /dev/null +++ b/imgsearch/include/alibabacloud/imgsearch/model/ListImagesRequest.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_IMGSEARCH_MODEL_LISTIMAGESREQUEST_H_ +#define ALIBABACLOUD_IMGSEARCH_MODEL_LISTIMAGESREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Imgsearch + { + namespace Model + { + class ALIBABACLOUD_IMGSEARCH_EXPORT ListImagesRequest : public RpcServiceRequest + { + + public: + ListImagesRequest(); + ~ListImagesRequest(); + + std::string getEntityIdPrefix()const; + void setEntityIdPrefix(const std::string& entityIdPrefix); + int getLimit()const; + void setLimit(int limit); + std::string getOrder()const; + void setOrder(const std::string& order); + int getOffset()const; + void setOffset(int offset); + std::string getToken()const; + void setToken(const std::string& token); + std::string getDbName()const; + void setDbName(const std::string& dbName); + + private: + std::string entityIdPrefix_; + int limit_; + std::string order_; + int offset_; + std::string token_; + std::string dbName_; + + }; + } + } +} +#endif // !ALIBABACLOUD_IMGSEARCH_MODEL_LISTIMAGESREQUEST_H_ \ No newline at end of file diff --git a/imgsearch/include/alibabacloud/imgsearch/model/ListImagesResult.h b/imgsearch/include/alibabacloud/imgsearch/model/ListImagesResult.h new file mode 100644 index 000000000..9bf255e36 --- /dev/null +++ b/imgsearch/include/alibabacloud/imgsearch/model/ListImagesResult.h @@ -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. + */ + +#ifndef ALIBABACLOUD_IMGSEARCH_MODEL_LISTIMAGESRESULT_H_ +#define ALIBABACLOUD_IMGSEARCH_MODEL_LISTIMAGESRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Imgsearch + { + namespace Model + { + class ALIBABACLOUD_IMGSEARCH_EXPORT ListImagesResult : public ServiceResult + { + public: + struct Data + { + struct ImageListItem + { + std::string entityId; + std::string dataId; + long createdAt; + std::string extraData; + long updatedAt; + }; + int totalCount; + std::string token; + std::vector imageList; + }; + + + ListImagesResult(); + explicit ListImagesResult(const std::string &payload); + ~ListImagesResult(); + Data getData()const; + + protected: + void parse(const std::string &payload); + private: + Data data_; + + }; + } + } +} +#endif // !ALIBABACLOUD_IMGSEARCH_MODEL_LISTIMAGESRESULT_H_ \ No newline at end of file diff --git a/imgsearch/include/alibabacloud/imgsearch/model/SearchImageRequest.h b/imgsearch/include/alibabacloud/imgsearch/model/SearchImageRequest.h new file mode 100644 index 000000000..858224419 --- /dev/null +++ b/imgsearch/include/alibabacloud/imgsearch/model/SearchImageRequest.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_IMGSEARCH_MODEL_SEARCHIMAGEREQUEST_H_ +#define ALIBABACLOUD_IMGSEARCH_MODEL_SEARCHIMAGEREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Imgsearch + { + namespace Model + { + class ALIBABACLOUD_IMGSEARCH_EXPORT SearchImageRequest : public RpcServiceRequest + { + + public: + SearchImageRequest(); + ~SearchImageRequest(); + + std::string getDbName()const; + void setDbName(const std::string& dbName); + std::string getImageUrl()const; + void setImageUrl(const std::string& imageUrl); + int getLimit()const; + void setLimit(int limit); + + private: + std::string dbName_; + std::string imageUrl_; + int limit_; + + }; + } + } +} +#endif // !ALIBABACLOUD_IMGSEARCH_MODEL_SEARCHIMAGEREQUEST_H_ \ No newline at end of file diff --git a/imgsearch/include/alibabacloud/imgsearch/model/SearchImageResult.h b/imgsearch/include/alibabacloud/imgsearch/model/SearchImageResult.h new file mode 100644 index 000000000..b8f8455d3 --- /dev/null +++ b/imgsearch/include/alibabacloud/imgsearch/model/SearchImageResult.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_IMGSEARCH_MODEL_SEARCHIMAGERESULT_H_ +#define ALIBABACLOUD_IMGSEARCH_MODEL_SEARCHIMAGERESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Imgsearch + { + namespace Model + { + class ALIBABACLOUD_IMGSEARCH_EXPORT SearchImageResult : public ServiceResult + { + public: + struct Data + { + struct MatchListItem + { + std::string entityId; + float score; + std::string dataId; + std::string imageUrl; + std::string extraData; + }; + std::vector matchList; + }; + + + SearchImageResult(); + explicit SearchImageResult(const std::string &payload); + ~SearchImageResult(); + Data getData()const; + + protected: + void parse(const std::string &payload); + private: + Data data_; + + }; + } + } +} +#endif // !ALIBABACLOUD_IMGSEARCH_MODEL_SEARCHIMAGERESULT_H_ \ No newline at end of file diff --git a/imgsearch/src/ImgsearchClient.cc b/imgsearch/src/ImgsearchClient.cc new file mode 100644 index 000000000..0a164b3d1 --- /dev/null +++ b/imgsearch/src/ImgsearchClient.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::Imgsearch; +using namespace AlibabaCloud::Imgsearch::Model; + +namespace +{ + const std::string SERVICE_NAME = "imgsearch"; +} + +ImgsearchClient::ImgsearchClient(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, "imgsearch"); +} + +ImgsearchClient::ImgsearchClient(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, "imgsearch"); +} + +ImgsearchClient::ImgsearchClient(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, "imgsearch"); +} + +ImgsearchClient::~ImgsearchClient() +{} + +ImgsearchClient::AddImageOutcome ImgsearchClient::addImage(const AddImageRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return AddImageOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return AddImageOutcome(AddImageResult(outcome.result())); + else + return AddImageOutcome(outcome.error()); +} + +void ImgsearchClient::addImageAsync(const AddImageRequest& request, const AddImageAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, addImage(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +ImgsearchClient::AddImageOutcomeCallable ImgsearchClient::addImageCallable(const AddImageRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->addImage(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +ImgsearchClient::CreateImageDbOutcome ImgsearchClient::createImageDb(const CreateImageDbRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return CreateImageDbOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return CreateImageDbOutcome(CreateImageDbResult(outcome.result())); + else + return CreateImageDbOutcome(outcome.error()); +} + +void ImgsearchClient::createImageDbAsync(const CreateImageDbRequest& request, const CreateImageDbAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, createImageDb(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +ImgsearchClient::CreateImageDbOutcomeCallable ImgsearchClient::createImageDbCallable(const CreateImageDbRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->createImageDb(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +ImgsearchClient::DeleteImageOutcome ImgsearchClient::deleteImage(const DeleteImageRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return DeleteImageOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return DeleteImageOutcome(DeleteImageResult(outcome.result())); + else + return DeleteImageOutcome(outcome.error()); +} + +void ImgsearchClient::deleteImageAsync(const DeleteImageRequest& request, const DeleteImageAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, deleteImage(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +ImgsearchClient::DeleteImageOutcomeCallable ImgsearchClient::deleteImageCallable(const DeleteImageRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->deleteImage(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +ImgsearchClient::DeleteImageDbOutcome ImgsearchClient::deleteImageDb(const DeleteImageDbRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return DeleteImageDbOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return DeleteImageDbOutcome(DeleteImageDbResult(outcome.result())); + else + return DeleteImageDbOutcome(outcome.error()); +} + +void ImgsearchClient::deleteImageDbAsync(const DeleteImageDbRequest& request, const DeleteImageDbAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, deleteImageDb(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +ImgsearchClient::DeleteImageDbOutcomeCallable ImgsearchClient::deleteImageDbCallable(const DeleteImageDbRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->deleteImageDb(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +ImgsearchClient::ListImageDbsOutcome ImgsearchClient::listImageDbs(const ListImageDbsRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return ListImageDbsOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return ListImageDbsOutcome(ListImageDbsResult(outcome.result())); + else + return ListImageDbsOutcome(outcome.error()); +} + +void ImgsearchClient::listImageDbsAsync(const ListImageDbsRequest& request, const ListImageDbsAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, listImageDbs(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +ImgsearchClient::ListImageDbsOutcomeCallable ImgsearchClient::listImageDbsCallable(const ListImageDbsRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->listImageDbs(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +ImgsearchClient::ListImagesOutcome ImgsearchClient::listImages(const ListImagesRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return ListImagesOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return ListImagesOutcome(ListImagesResult(outcome.result())); + else + return ListImagesOutcome(outcome.error()); +} + +void ImgsearchClient::listImagesAsync(const ListImagesRequest& request, const ListImagesAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, listImages(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +ImgsearchClient::ListImagesOutcomeCallable ImgsearchClient::listImagesCallable(const ListImagesRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->listImages(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +ImgsearchClient::SearchImageOutcome ImgsearchClient::searchImage(const SearchImageRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return SearchImageOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return SearchImageOutcome(SearchImageResult(outcome.result())); + else + return SearchImageOutcome(outcome.error()); +} + +void ImgsearchClient::searchImageAsync(const SearchImageRequest& request, const SearchImageAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, searchImage(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +ImgsearchClient::SearchImageOutcomeCallable ImgsearchClient::searchImageCallable(const SearchImageRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->searchImage(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + diff --git a/imgsearch/src/model/AddImageRequest.cc b/imgsearch/src/model/AddImageRequest.cc new file mode 100644 index 000000000..79408f897 --- /dev/null +++ b/imgsearch/src/model/AddImageRequest.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::Imgsearch::Model::AddImageRequest; + +AddImageRequest::AddImageRequest() : + RpcServiceRequest("imgsearch", "2020-03-20", "AddImage") +{ + setMethod(HttpRequest::Method::Post); +} + +AddImageRequest::~AddImageRequest() +{} + +std::string AddImageRequest::getEntityId()const +{ + return entityId_; +} + +void AddImageRequest::setEntityId(const std::string& entityId) +{ + entityId_ = entityId; + setBodyParameter("EntityId", entityId); +} + +std::string AddImageRequest::getDbName()const +{ + return dbName_; +} + +void AddImageRequest::setDbName(const std::string& dbName) +{ + dbName_ = dbName; + setBodyParameter("DbName", dbName); +} + +std::string AddImageRequest::getImageUrl()const +{ + return imageUrl_; +} + +void AddImageRequest::setImageUrl(const std::string& imageUrl) +{ + imageUrl_ = imageUrl; + setBodyParameter("ImageUrl", imageUrl); +} + +std::string AddImageRequest::getExtraData()const +{ + return extraData_; +} + +void AddImageRequest::setExtraData(const std::string& extraData) +{ + extraData_ = extraData; + setBodyParameter("ExtraData", extraData); +} + diff --git a/imgsearch/src/model/AddImageResult.cc b/imgsearch/src/model/AddImageResult.cc new file mode 100644 index 000000000..ce53ddcc3 --- /dev/null +++ b/imgsearch/src/model/AddImageResult.cc @@ -0,0 +1,52 @@ +/* + * 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::Imgsearch; +using namespace AlibabaCloud::Imgsearch::Model; + +AddImageResult::AddImageResult() : + ServiceResult() +{} + +AddImageResult::AddImageResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +AddImageResult::~AddImageResult() +{} + +void AddImageResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto dataNode = value["Data"]; + if(!dataNode["DataId"].isNull()) + data_.dataId = dataNode["DataId"].asString(); + +} + +AddImageResult::Data AddImageResult::getData()const +{ + return data_; +} + diff --git a/imgsearch/src/model/CreateImageDbRequest.cc b/imgsearch/src/model/CreateImageDbRequest.cc new file mode 100644 index 000000000..56b5e1375 --- /dev/null +++ b/imgsearch/src/model/CreateImageDbRequest.cc @@ -0,0 +1,40 @@ +/* + * 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::Imgsearch::Model::CreateImageDbRequest; + +CreateImageDbRequest::CreateImageDbRequest() : + RpcServiceRequest("imgsearch", "2020-03-20", "CreateImageDb") +{ + setMethod(HttpRequest::Method::Post); +} + +CreateImageDbRequest::~CreateImageDbRequest() +{} + +std::string CreateImageDbRequest::getName()const +{ + return name_; +} + +void CreateImageDbRequest::setName(const std::string& name) +{ + name_ = name; + setBodyParameter("Name", name); +} + diff --git a/imgsearch/src/model/CreateImageDbResult.cc b/imgsearch/src/model/CreateImageDbResult.cc new file mode 100644 index 000000000..8451ce89a --- /dev/null +++ b/imgsearch/src/model/CreateImageDbResult.cc @@ -0,0 +1,44 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +using namespace AlibabaCloud::Imgsearch; +using namespace AlibabaCloud::Imgsearch::Model; + +CreateImageDbResult::CreateImageDbResult() : + ServiceResult() +{} + +CreateImageDbResult::CreateImageDbResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +CreateImageDbResult::~CreateImageDbResult() +{} + +void CreateImageDbResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + +} + diff --git a/imgsearch/src/model/DeleteImageDbRequest.cc b/imgsearch/src/model/DeleteImageDbRequest.cc new file mode 100644 index 000000000..4d57e89d2 --- /dev/null +++ b/imgsearch/src/model/DeleteImageDbRequest.cc @@ -0,0 +1,40 @@ +/* + * 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::Imgsearch::Model::DeleteImageDbRequest; + +DeleteImageDbRequest::DeleteImageDbRequest() : + RpcServiceRequest("imgsearch", "2020-03-20", "DeleteImageDb") +{ + setMethod(HttpRequest::Method::Post); +} + +DeleteImageDbRequest::~DeleteImageDbRequest() +{} + +std::string DeleteImageDbRequest::getName()const +{ + return name_; +} + +void DeleteImageDbRequest::setName(const std::string& name) +{ + name_ = name; + setBodyParameter("Name", name); +} + diff --git a/imgsearch/src/model/DeleteImageDbResult.cc b/imgsearch/src/model/DeleteImageDbResult.cc new file mode 100644 index 000000000..31b73fd3b --- /dev/null +++ b/imgsearch/src/model/DeleteImageDbResult.cc @@ -0,0 +1,44 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +using namespace AlibabaCloud::Imgsearch; +using namespace AlibabaCloud::Imgsearch::Model; + +DeleteImageDbResult::DeleteImageDbResult() : + ServiceResult() +{} + +DeleteImageDbResult::DeleteImageDbResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +DeleteImageDbResult::~DeleteImageDbResult() +{} + +void DeleteImageDbResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + +} + diff --git a/imgsearch/src/model/DeleteImageRequest.cc b/imgsearch/src/model/DeleteImageRequest.cc new file mode 100644 index 000000000..8583d0c07 --- /dev/null +++ b/imgsearch/src/model/DeleteImageRequest.cc @@ -0,0 +1,51 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +using AlibabaCloud::Imgsearch::Model::DeleteImageRequest; + +DeleteImageRequest::DeleteImageRequest() : + RpcServiceRequest("imgsearch", "2020-03-20", "DeleteImage") +{ + setMethod(HttpRequest::Method::Post); +} + +DeleteImageRequest::~DeleteImageRequest() +{} + +std::string DeleteImageRequest::getEntityId()const +{ + return entityId_; +} + +void DeleteImageRequest::setEntityId(const std::string& entityId) +{ + entityId_ = entityId; + setBodyParameter("EntityId", entityId); +} + +std::string DeleteImageRequest::getDbName()const +{ + return dbName_; +} + +void DeleteImageRequest::setDbName(const std::string& dbName) +{ + dbName_ = dbName; + setBodyParameter("DbName", dbName); +} + diff --git a/imgsearch/src/model/DeleteImageResult.cc b/imgsearch/src/model/DeleteImageResult.cc new file mode 100644 index 000000000..e3e209842 --- /dev/null +++ b/imgsearch/src/model/DeleteImageResult.cc @@ -0,0 +1,44 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +using namespace AlibabaCloud::Imgsearch; +using namespace AlibabaCloud::Imgsearch::Model; + +DeleteImageResult::DeleteImageResult() : + ServiceResult() +{} + +DeleteImageResult::DeleteImageResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +DeleteImageResult::~DeleteImageResult() +{} + +void DeleteImageResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + +} + diff --git a/imgsearch/src/model/ListImageDbsRequest.cc b/imgsearch/src/model/ListImageDbsRequest.cc new file mode 100644 index 000000000..2c9252e41 --- /dev/null +++ b/imgsearch/src/model/ListImageDbsRequest.cc @@ -0,0 +1,29 @@ +/* + * 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::Imgsearch::Model::ListImageDbsRequest; + +ListImageDbsRequest::ListImageDbsRequest() : + RpcServiceRequest("imgsearch", "2020-03-20", "ListImageDbs") +{ + setMethod(HttpRequest::Method::Post); +} + +ListImageDbsRequest::~ListImageDbsRequest() +{} + diff --git a/imgsearch/src/model/ListImageDbsResult.cc b/imgsearch/src/model/ListImageDbsResult.cc new file mode 100644 index 000000000..d84ecdd5b --- /dev/null +++ b/imgsearch/src/model/ListImageDbsResult.cc @@ -0,0 +1,58 @@ +/* + * 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::Imgsearch; +using namespace AlibabaCloud::Imgsearch::Model; + +ListImageDbsResult::ListImageDbsResult() : + ServiceResult() +{} + +ListImageDbsResult::ListImageDbsResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +ListImageDbsResult::~ListImageDbsResult() +{} + +void ListImageDbsResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto dataNode = value["Data"]; + auto allDbListNode = dataNode["DbList"]["DbListItem"]; + for (auto dataNodeDbListDbListItem : allDbListNode) + { + Data::DbListItem dbListItemObject; + if(!dataNodeDbListDbListItem["Name"].isNull()) + dbListItemObject.name = dataNodeDbListDbListItem["Name"].asString(); + data_.dbList.push_back(dbListItemObject); + } + +} + +ListImageDbsResult::Data ListImageDbsResult::getData()const +{ + return data_; +} + diff --git a/imgsearch/src/model/ListImagesRequest.cc b/imgsearch/src/model/ListImagesRequest.cc new file mode 100644 index 000000000..2d34c7029 --- /dev/null +++ b/imgsearch/src/model/ListImagesRequest.cc @@ -0,0 +1,95 @@ +/* + * 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::Imgsearch::Model::ListImagesRequest; + +ListImagesRequest::ListImagesRequest() : + RpcServiceRequest("imgsearch", "2020-03-20", "ListImages") +{ + setMethod(HttpRequest::Method::Post); +} + +ListImagesRequest::~ListImagesRequest() +{} + +std::string ListImagesRequest::getEntityIdPrefix()const +{ + return entityIdPrefix_; +} + +void ListImagesRequest::setEntityIdPrefix(const std::string& entityIdPrefix) +{ + entityIdPrefix_ = entityIdPrefix; + setBodyParameter("EntityIdPrefix", entityIdPrefix); +} + +int ListImagesRequest::getLimit()const +{ + return limit_; +} + +void ListImagesRequest::setLimit(int limit) +{ + limit_ = limit; + setBodyParameter("Limit", std::to_string(limit)); +} + +std::string ListImagesRequest::getOrder()const +{ + return order_; +} + +void ListImagesRequest::setOrder(const std::string& order) +{ + order_ = order; + setBodyParameter("Order", order); +} + +int ListImagesRequest::getOffset()const +{ + return offset_; +} + +void ListImagesRequest::setOffset(int offset) +{ + offset_ = offset; + setBodyParameter("Offset", std::to_string(offset)); +} + +std::string ListImagesRequest::getToken()const +{ + return token_; +} + +void ListImagesRequest::setToken(const std::string& token) +{ + token_ = token; + setBodyParameter("Token", token); +} + +std::string ListImagesRequest::getDbName()const +{ + return dbName_; +} + +void ListImagesRequest::setDbName(const std::string& dbName) +{ + dbName_ = dbName; + setBodyParameter("DbName", dbName); +} + diff --git a/imgsearch/src/model/ListImagesResult.cc b/imgsearch/src/model/ListImagesResult.cc new file mode 100644 index 000000000..f06507d8b --- /dev/null +++ b/imgsearch/src/model/ListImagesResult.cc @@ -0,0 +1,70 @@ +/* + * 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::Imgsearch; +using namespace AlibabaCloud::Imgsearch::Model; + +ListImagesResult::ListImagesResult() : + ServiceResult() +{} + +ListImagesResult::ListImagesResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +ListImagesResult::~ListImagesResult() +{} + +void ListImagesResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto dataNode = value["Data"]; + if(!dataNode["Token"].isNull()) + data_.token = dataNode["Token"].asString(); + if(!dataNode["TotalCount"].isNull()) + data_.totalCount = std::stoi(dataNode["TotalCount"].asString()); + auto allImageListNode = dataNode["ImageList"]["ImageListItem"]; + for (auto dataNodeImageListImageListItem : allImageListNode) + { + Data::ImageListItem imageListItemObject; + if(!dataNodeImageListImageListItem["DataId"].isNull()) + imageListItemObject.dataId = dataNodeImageListImageListItem["DataId"].asString(); + if(!dataNodeImageListImageListItem["ExtraData"].isNull()) + imageListItemObject.extraData = dataNodeImageListImageListItem["ExtraData"].asString(); + if(!dataNodeImageListImageListItem["EntityId"].isNull()) + imageListItemObject.entityId = dataNodeImageListImageListItem["EntityId"].asString(); + if(!dataNodeImageListImageListItem["UpdatedAt"].isNull()) + imageListItemObject.updatedAt = std::stol(dataNodeImageListImageListItem["UpdatedAt"].asString()); + if(!dataNodeImageListImageListItem["CreatedAt"].isNull()) + imageListItemObject.createdAt = std::stol(dataNodeImageListImageListItem["CreatedAt"].asString()); + data_.imageList.push_back(imageListItemObject); + } + +} + +ListImagesResult::Data ListImagesResult::getData()const +{ + return data_; +} + diff --git a/imgsearch/src/model/SearchImageRequest.cc b/imgsearch/src/model/SearchImageRequest.cc new file mode 100644 index 000000000..72dff463e --- /dev/null +++ b/imgsearch/src/model/SearchImageRequest.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::Imgsearch::Model::SearchImageRequest; + +SearchImageRequest::SearchImageRequest() : + RpcServiceRequest("imgsearch", "2020-03-20", "SearchImage") +{ + setMethod(HttpRequest::Method::Post); +} + +SearchImageRequest::~SearchImageRequest() +{} + +std::string SearchImageRequest::getDbName()const +{ + return dbName_; +} + +void SearchImageRequest::setDbName(const std::string& dbName) +{ + dbName_ = dbName; + setBodyParameter("DbName", dbName); +} + +std::string SearchImageRequest::getImageUrl()const +{ + return imageUrl_; +} + +void SearchImageRequest::setImageUrl(const std::string& imageUrl) +{ + imageUrl_ = imageUrl; + setBodyParameter("ImageUrl", imageUrl); +} + +int SearchImageRequest::getLimit()const +{ + return limit_; +} + +void SearchImageRequest::setLimit(int limit) +{ + limit_ = limit; + setBodyParameter("Limit", std::to_string(limit)); +} + diff --git a/imgsearch/src/model/SearchImageResult.cc b/imgsearch/src/model/SearchImageResult.cc new file mode 100644 index 000000000..2b1c61d4f --- /dev/null +++ b/imgsearch/src/model/SearchImageResult.cc @@ -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. + */ + +#include +#include + +using namespace AlibabaCloud::Imgsearch; +using namespace AlibabaCloud::Imgsearch::Model; + +SearchImageResult::SearchImageResult() : + ServiceResult() +{} + +SearchImageResult::SearchImageResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +SearchImageResult::~SearchImageResult() +{} + +void SearchImageResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto dataNode = value["Data"]; + auto allMatchListNode = dataNode["MatchList"]["MatchListItem"]; + for (auto dataNodeMatchListMatchListItem : allMatchListNode) + { + Data::MatchListItem matchListItemObject; + if(!dataNodeMatchListMatchListItem["DataId"].isNull()) + matchListItemObject.dataId = dataNodeMatchListMatchListItem["DataId"].asString(); + if(!dataNodeMatchListMatchListItem["ExtraData"].isNull()) + matchListItemObject.extraData = dataNodeMatchListMatchListItem["ExtraData"].asString(); + if(!dataNodeMatchListMatchListItem["EntityId"].isNull()) + matchListItemObject.entityId = dataNodeMatchListMatchListItem["EntityId"].asString(); + if(!dataNodeMatchListMatchListItem["ImageUrl"].isNull()) + matchListItemObject.imageUrl = dataNodeMatchListMatchListItem["ImageUrl"].asString(); + if(!dataNodeMatchListMatchListItem["Score"].isNull()) + matchListItemObject.score = std::stof(dataNodeMatchListMatchListItem["Score"].asString()); + data_.matchList.push_back(matchListItemObject); + } + +} + +SearchImageResult::Data SearchImageResult::getData()const +{ + return data_; +} +