Update SearchImage.

This commit is contained in:
sdk-team
2020-08-08 17:13:38 +08:00
parent 83bb5be02b
commit 3a88e60d04
34 changed files with 2076 additions and 1 deletions

View File

@@ -1,3 +1,6 @@
2020-08-08 Version: 1.36.562
- Update SearchImage.
2020-08-07 Version: 1.36.561
- GetTitleDiagnose GetTitleGenerate GetImageTranslate supported.

View File

@@ -1 +1 @@
1.36.561
1.36.562

110
imgsearch/CMakeLists.txt Normal file
View File

@@ -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}
)

View File

@@ -0,0 +1,102 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ALIBABACLOUD_IMGSEARCH_IMGSEARCHCLIENT_H_
#define ALIBABACLOUD_IMGSEARCH_IMGSEARCHCLIENT_H_
#include <future>
#include <alibabacloud/core/AsyncCallerContext.h>
#include <alibabacloud/core/EndpointProvider.h>
#include <alibabacloud/core/RpcServiceClient.h>
#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<Error, Model::AddImageResult> AddImageOutcome;
typedef std::future<AddImageOutcome> AddImageOutcomeCallable;
typedef std::function<void(const ImgsearchClient*, const Model::AddImageRequest&, const AddImageOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> AddImageAsyncHandler;
typedef Outcome<Error, Model::CreateImageDbResult> CreateImageDbOutcome;
typedef std::future<CreateImageDbOutcome> CreateImageDbOutcomeCallable;
typedef std::function<void(const ImgsearchClient*, const Model::CreateImageDbRequest&, const CreateImageDbOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> CreateImageDbAsyncHandler;
typedef Outcome<Error, Model::DeleteImageResult> DeleteImageOutcome;
typedef std::future<DeleteImageOutcome> DeleteImageOutcomeCallable;
typedef std::function<void(const ImgsearchClient*, const Model::DeleteImageRequest&, const DeleteImageOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DeleteImageAsyncHandler;
typedef Outcome<Error, Model::DeleteImageDbResult> DeleteImageDbOutcome;
typedef std::future<DeleteImageDbOutcome> DeleteImageDbOutcomeCallable;
typedef std::function<void(const ImgsearchClient*, const Model::DeleteImageDbRequest&, const DeleteImageDbOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DeleteImageDbAsyncHandler;
typedef Outcome<Error, Model::ListImageDbsResult> ListImageDbsOutcome;
typedef std::future<ListImageDbsOutcome> ListImageDbsOutcomeCallable;
typedef std::function<void(const ImgsearchClient*, const Model::ListImageDbsRequest&, const ListImageDbsOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ListImageDbsAsyncHandler;
typedef Outcome<Error, Model::ListImagesResult> ListImagesOutcome;
typedef std::future<ListImagesOutcome> ListImagesOutcomeCallable;
typedef std::function<void(const ImgsearchClient*, const Model::ListImagesRequest&, const ListImagesOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ListImagesAsyncHandler;
typedef Outcome<Error, Model::SearchImageResult> SearchImageOutcome;
typedef std::future<SearchImageOutcome> SearchImageOutcomeCallable;
typedef std::function<void(const ImgsearchClient*, const Model::SearchImageRequest&, const SearchImageOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> SearchImageAsyncHandler;
ImgsearchClient(const Credentials &credentials, const ClientConfiguration &configuration);
ImgsearchClient(const std::shared_ptr<CredentialsProvider> &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<const AsyncCallerContext>& 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<const AsyncCallerContext>& 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<const AsyncCallerContext>& 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<const AsyncCallerContext>& 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<const AsyncCallerContext>& 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<const AsyncCallerContext>& 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<const AsyncCallerContext>& context = nullptr) const;
SearchImageOutcomeCallable searchImageCallable(const Model::SearchImageRequest& request) const;
private:
std::shared_ptr<EndpointProvider> endpointProvider_;
};
}
}
#endif // !ALIBABACLOUD_IMGSEARCH_IMGSEARCHCLIENT_H_

View File

@@ -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 <alibabacloud/core/Global.h>
#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_

View File

@@ -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 <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/imgsearch/ImgsearchExport.h>
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_

View File

@@ -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 <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/imgsearch/ImgsearchExport.h>
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_

View File

@@ -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 <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/imgsearch/ImgsearchExport.h>
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_

View File

@@ -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 <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/imgsearch/ImgsearchExport.h>
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_

View File

@@ -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 <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/imgsearch/ImgsearchExport.h>
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_

View File

@@ -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 <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/imgsearch/ImgsearchExport.h>
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_

View File

@@ -0,0 +1,51 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ALIBABACLOUD_IMGSEARCH_MODEL_DELETEIMAGEREQUEST_H_
#define ALIBABACLOUD_IMGSEARCH_MODEL_DELETEIMAGEREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/imgsearch/ImgsearchExport.h>
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_

View File

@@ -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 <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/imgsearch/ImgsearchExport.h>
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_

View File

@@ -0,0 +1,45 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ALIBABACLOUD_IMGSEARCH_MODEL_LISTIMAGEDBSREQUEST_H_
#define ALIBABACLOUD_IMGSEARCH_MODEL_LISTIMAGEDBSREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/imgsearch/ImgsearchExport.h>
namespace AlibabaCloud
{
namespace Imgsearch
{
namespace Model
{
class ALIBABACLOUD_IMGSEARCH_EXPORT ListImageDbsRequest : public RpcServiceRequest
{
public:
ListImageDbsRequest();
~ListImageDbsRequest();
private:
};
}
}
}
#endif // !ALIBABACLOUD_IMGSEARCH_MODEL_LISTIMAGEDBSREQUEST_H_

View File

@@ -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 <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/imgsearch/ImgsearchExport.h>
namespace AlibabaCloud
{
namespace Imgsearch
{
namespace Model
{
class ALIBABACLOUD_IMGSEARCH_EXPORT ListImageDbsResult : public ServiceResult
{
public:
struct Data
{
struct DbListItem
{
std::string name;
};
std::vector<DbListItem> 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_

View File

@@ -0,0 +1,63 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ALIBABACLOUD_IMGSEARCH_MODEL_LISTIMAGESREQUEST_H_
#define ALIBABACLOUD_IMGSEARCH_MODEL_LISTIMAGESREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/imgsearch/ImgsearchExport.h>
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_

View File

@@ -0,0 +1,65 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ALIBABACLOUD_IMGSEARCH_MODEL_LISTIMAGESRESULT_H_
#define ALIBABACLOUD_IMGSEARCH_MODEL_LISTIMAGESRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/imgsearch/ImgsearchExport.h>
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<ImageListItem> 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_

View File

@@ -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 <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/imgsearch/ImgsearchExport.h>
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_

View File

@@ -0,0 +1,63 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ALIBABACLOUD_IMGSEARCH_MODEL_SEARCHIMAGERESULT_H_
#define ALIBABACLOUD_IMGSEARCH_MODEL_SEARCHIMAGERESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/imgsearch/ImgsearchExport.h>
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<MatchListItem> 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_

View File

@@ -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 <alibabacloud/imgsearch/ImgsearchClient.h>
#include <alibabacloud/core/SimpleCredentialsProvider.h>
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<SimpleCredentialsProvider>(credentials), configuration)
{
auto locationClient = std::make_shared<LocationClient>(credentials, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "imgsearch");
}
ImgsearchClient::ImgsearchClient(const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) :
RpcServiceClient(SERVICE_NAME, credentialsProvider, configuration)
{
auto locationClient = std::make_shared<LocationClient>(credentialsProvider, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "imgsearch");
}
ImgsearchClient::ImgsearchClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) :
RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(accessKeyId, accessKeySecret), configuration)
{
auto locationClient = std::make_shared<LocationClient>(accessKeyId, accessKeySecret, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "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<const AsyncCallerContext>& 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<std::packaged_task<AddImageOutcome()>>(
[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<const AsyncCallerContext>& 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<std::packaged_task<CreateImageDbOutcome()>>(
[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<const AsyncCallerContext>& 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<std::packaged_task<DeleteImageOutcome()>>(
[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<const AsyncCallerContext>& 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<std::packaged_task<DeleteImageDbOutcome()>>(
[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<const AsyncCallerContext>& 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<std::packaged_task<ListImageDbsOutcome()>>(
[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<const AsyncCallerContext>& 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<std::packaged_task<ListImagesOutcome()>>(
[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<const AsyncCallerContext>& 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<std::packaged_task<SearchImageOutcome()>>(
[this, request]()
{
return this->searchImage(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}

View File

@@ -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 <alibabacloud/imgsearch/model/AddImageRequest.h>
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);
}

View File

@@ -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 <alibabacloud/imgsearch/model/AddImageResult.h>
#include <json/json.h>
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_;
}

View File

@@ -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 <alibabacloud/imgsearch/model/CreateImageDbRequest.h>
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);
}

View File

@@ -0,0 +1,44 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <alibabacloud/imgsearch/model/CreateImageDbResult.h>
#include <json/json.h>
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());
}

View File

@@ -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 <alibabacloud/imgsearch/model/DeleteImageDbRequest.h>
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);
}

View File

@@ -0,0 +1,44 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <alibabacloud/imgsearch/model/DeleteImageDbResult.h>
#include <json/json.h>
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());
}

View File

@@ -0,0 +1,51 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <alibabacloud/imgsearch/model/DeleteImageRequest.h>
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);
}

View File

@@ -0,0 +1,44 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <alibabacloud/imgsearch/model/DeleteImageResult.h>
#include <json/json.h>
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());
}

View File

@@ -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 <alibabacloud/imgsearch/model/ListImageDbsRequest.h>
using AlibabaCloud::Imgsearch::Model::ListImageDbsRequest;
ListImageDbsRequest::ListImageDbsRequest() :
RpcServiceRequest("imgsearch", "2020-03-20", "ListImageDbs")
{
setMethod(HttpRequest::Method::Post);
}
ListImageDbsRequest::~ListImageDbsRequest()
{}

View File

@@ -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 <alibabacloud/imgsearch/model/ListImageDbsResult.h>
#include <json/json.h>
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_;
}

View File

@@ -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 <alibabacloud/imgsearch/model/ListImagesRequest.h>
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);
}

View File

@@ -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 <alibabacloud/imgsearch/model/ListImagesResult.h>
#include <json/json.h>
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_;
}

View File

@@ -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 <alibabacloud/imgsearch/model/SearchImageRequest.h>
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));
}

View File

@@ -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 <alibabacloud/imgsearch/model/SearchImageResult.h>
#include <json/json.h>
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_;
}