Compare commits

...

15 Commits

Author SHA1 Message Date
sdk-team
e7b81546c4 Update imgsearch. 2020-11-16 02:55:38 +00:00
sdk-team
7f711be94a Update imagerecog. 2020-11-16 02:47:26 +00:00
sdk-team
b5e667c1d7 Update goodstech. 2020-11-16 02:36:26 +00:00
sdk-team
2d9dc66719 Update Imageaudit. 2020-11-13 09:47:30 +00:00
sdk-team
97fa00faef Add DeccribeEngineVersion DescribeTasks DescribeInstanceConfig and more APIs. 2020-11-13 09:37:47 +00:00
sdk-team
630656ce24 Fix GetBranchInfo and DeleteBranch API 404 error. 2020-11-13 06:29:26 +00:00
sdk-team
f3b00eade0 Release ErasePerson. 2020-11-13 06:23:02 +00:00
sdk-team
02122aa7ea Release DetectCardScreenshot RecognizePoiName. 2020-11-13 06:21:27 +00:00
sdk-team
67d6a5f9d4 Release GenerateHumanAnimeStyle CountCrowd. 2020-11-13 06:14:56 +00:00
sdk-team
a15a171b2d Release SegmentHDSky SegmentHDCommonImage. 2020-11-13 06:12:31 +00:00
sdk-team
9d980b6731 Support drm. 2020-11-12 11:39:38 +00:00
sdk-team
d6aeb545bc Generated 2019-06-01 for smc. 2020-11-12 07:58:51 +00:00
sdk-team
6217773578 Update new version. 2020-11-12 06:06:17 +00:00
sdk-team
cb2d0e9b5d Support DescribeDBClusterTDE. 2020-11-12 03:13:57 +00:00
sdk-team
2ee11b248a Supported Open Api. 2020-11-12 02:45:42 +00:00
227 changed files with 11227 additions and 791 deletions

View File

@@ -1,3 +1,50 @@
2020-11-16 Version: patch
- Update imgsearch.
2020-11-16 Version: patch
- Update imagerecog.
2020-11-16 Version: patch
- Update goodstech.
2020-11-13 Version: patch
- Update Imageaudit.
2020-11-13 Version: patch
- Add DeccribeEngineVersion DescribeTasks DescribeInstanceConfig and more APIs.
2020-11-13 Version: patch
- Fix GetBranchInfo and DeleteBranch API 404 error.
- Add ListRepositoryBranches and GetGroupDetail API.
2020-11-13 Version: patch
- Release ErasePerson.
2020-11-13 Version: patch
- Release DetectCardScreenshot RecognizePoiName.
2020-11-13 Version: patch
- Release GenerateHumanAnimeStyle CountCrowd.
2020-11-13 Version: patch
- Release SegmentHDSky SegmentHDCommonImage.
2020-11-12 Version: patch
- Support drm.
2020-11-12 Version: patch
- Generated 2019-06-01 for `smc`.
2020-11-12 Version: patch
- Update new version.
2020-11-12 Version: patch
- Support DescribeDBClusterTDE.
- Support ModifyDBClusterTDE.
2020-11-12 Version: patch
- Supported Open Api.
2020-11-12 Version: patch
- Support OpenAPI.

View File

@@ -57,6 +57,8 @@ set(codeup_public_header_model
include/alibabacloud/codeup/model/GetCodeupOrganizationResult.h
include/alibabacloud/codeup/model/GetFileBlobsRequest.h
include/alibabacloud/codeup/model/GetFileBlobsResult.h
include/alibabacloud/codeup/model/GetGroupDetailRequest.h
include/alibabacloud/codeup/model/GetGroupDetailResult.h
include/alibabacloud/codeup/model/GetProjectMemberRequest.h
include/alibabacloud/codeup/model/GetProjectMemberResult.h
include/alibabacloud/codeup/model/GetRepositoryInfoRequest.h
@@ -67,6 +69,8 @@ set(codeup_public_header_model
include/alibabacloud/codeup/model/ListGroupRepositoriesResult.h
include/alibabacloud/codeup/model/ListGroupsRequest.h
include/alibabacloud/codeup/model/ListGroupsResult.h
include/alibabacloud/codeup/model/ListRepositoryBranchesRequest.h
include/alibabacloud/codeup/model/ListRepositoryBranchesResult.h
include/alibabacloud/codeup/model/ListRepositoryMemberRequest.h
include/alibabacloud/codeup/model/ListRepositoryMemberResult.h
include/alibabacloud/codeup/model/ListRepositoryTreeRequest.h
@@ -118,6 +122,8 @@ set(codeup_src
src/model/GetCodeupOrganizationResult.cc
src/model/GetFileBlobsRequest.cc
src/model/GetFileBlobsResult.cc
src/model/GetGroupDetailRequest.cc
src/model/GetGroupDetailResult.cc
src/model/GetProjectMemberRequest.cc
src/model/GetProjectMemberResult.cc
src/model/GetRepositoryInfoRequest.cc
@@ -128,6 +134,8 @@ set(codeup_src
src/model/ListGroupRepositoriesResult.cc
src/model/ListGroupsRequest.cc
src/model/ListGroupsResult.cc
src/model/ListRepositoryBranchesRequest.cc
src/model/ListRepositoryBranchesResult.cc
src/model/ListRepositoryMemberRequest.cc
src/model/ListRepositoryMemberResult.cc
src/model/ListRepositoryTreeRequest.cc

View File

@@ -58,6 +58,8 @@
#include "model/GetCodeupOrganizationResult.h"
#include "model/GetFileBlobsRequest.h"
#include "model/GetFileBlobsResult.h"
#include "model/GetGroupDetailRequest.h"
#include "model/GetGroupDetailResult.h"
#include "model/GetProjectMemberRequest.h"
#include "model/GetProjectMemberResult.h"
#include "model/GetRepositoryInfoRequest.h"
@@ -68,6 +70,8 @@
#include "model/ListGroupRepositoriesResult.h"
#include "model/ListGroupsRequest.h"
#include "model/ListGroupsResult.h"
#include "model/ListRepositoryBranchesRequest.h"
#include "model/ListRepositoryBranchesResult.h"
#include "model/ListRepositoryMemberRequest.h"
#include "model/ListRepositoryMemberResult.h"
#include "model/ListRepositoryTreeRequest.h"
@@ -143,6 +147,9 @@ namespace AlibabaCloud
typedef Outcome<Error, Model::GetFileBlobsResult> GetFileBlobsOutcome;
typedef std::future<GetFileBlobsOutcome> GetFileBlobsOutcomeCallable;
typedef std::function<void(const CodeupClient*, const Model::GetFileBlobsRequest&, const GetFileBlobsOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetFileBlobsAsyncHandler;
typedef Outcome<Error, Model::GetGroupDetailResult> GetGroupDetailOutcome;
typedef std::future<GetGroupDetailOutcome> GetGroupDetailOutcomeCallable;
typedef std::function<void(const CodeupClient*, const Model::GetGroupDetailRequest&, const GetGroupDetailOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetGroupDetailAsyncHandler;
typedef Outcome<Error, Model::GetProjectMemberResult> GetProjectMemberOutcome;
typedef std::future<GetProjectMemberOutcome> GetProjectMemberOutcomeCallable;
typedef std::function<void(const CodeupClient*, const Model::GetProjectMemberRequest&, const GetProjectMemberOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetProjectMemberAsyncHandler;
@@ -158,6 +165,9 @@ namespace AlibabaCloud
typedef Outcome<Error, Model::ListGroupsResult> ListGroupsOutcome;
typedef std::future<ListGroupsOutcome> ListGroupsOutcomeCallable;
typedef std::function<void(const CodeupClient*, const Model::ListGroupsRequest&, const ListGroupsOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ListGroupsAsyncHandler;
typedef Outcome<Error, Model::ListRepositoryBranchesResult> ListRepositoryBranchesOutcome;
typedef std::future<ListRepositoryBranchesOutcome> ListRepositoryBranchesOutcomeCallable;
typedef std::function<void(const CodeupClient*, const Model::ListRepositoryBranchesRequest&, const ListRepositoryBranchesOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ListRepositoryBranchesAsyncHandler;
typedef Outcome<Error, Model::ListRepositoryMemberResult> ListRepositoryMemberOutcome;
typedef std::future<ListRepositoryMemberOutcome> ListRepositoryMemberOutcomeCallable;
typedef std::function<void(const CodeupClient*, const Model::ListRepositoryMemberRequest&, const ListRepositoryMemberOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ListRepositoryMemberAsyncHandler;
@@ -235,6 +245,9 @@ namespace AlibabaCloud
GetFileBlobsOutcome getFileBlobs(const Model::GetFileBlobsRequest &request)const;
void getFileBlobsAsync(const Model::GetFileBlobsRequest& request, const GetFileBlobsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
GetFileBlobsOutcomeCallable getFileBlobsCallable(const Model::GetFileBlobsRequest& request) const;
GetGroupDetailOutcome getGroupDetail(const Model::GetGroupDetailRequest &request)const;
void getGroupDetailAsync(const Model::GetGroupDetailRequest& request, const GetGroupDetailAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
GetGroupDetailOutcomeCallable getGroupDetailCallable(const Model::GetGroupDetailRequest& request) const;
GetProjectMemberOutcome getProjectMember(const Model::GetProjectMemberRequest &request)const;
void getProjectMemberAsync(const Model::GetProjectMemberRequest& request, const GetProjectMemberAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
GetProjectMemberOutcomeCallable getProjectMemberCallable(const Model::GetProjectMemberRequest& request) const;
@@ -250,6 +263,9 @@ namespace AlibabaCloud
ListGroupsOutcome listGroups(const Model::ListGroupsRequest &request)const;
void listGroupsAsync(const Model::ListGroupsRequest& request, const ListGroupsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
ListGroupsOutcomeCallable listGroupsCallable(const Model::ListGroupsRequest& request) const;
ListRepositoryBranchesOutcome listRepositoryBranches(const Model::ListRepositoryBranchesRequest &request)const;
void listRepositoryBranchesAsync(const Model::ListRepositoryBranchesRequest& request, const ListRepositoryBranchesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
ListRepositoryBranchesOutcomeCallable listRepositoryBranchesCallable(const Model::ListRepositoryBranchesRequest& request) const;
ListRepositoryMemberOutcome listRepositoryMember(const Model::ListRepositoryMemberRequest &request)const;
void listRepositoryMemberAsync(const Model::ListRepositoryMemberRequest& request, const ListRepositoryMemberAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
ListRepositoryMemberOutcomeCallable listRepositoryMemberCallable(const Model::ListRepositoryMemberRequest& request) const;

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_CODEUP_MODEL_GETGROUPDETAILREQUEST_H_
#define ALIBABACLOUD_CODEUP_MODEL_GETGROUPDETAILREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RoaServiceRequest.h>
#include <alibabacloud/codeup/CodeupExport.h>
namespace AlibabaCloud
{
namespace Codeup
{
namespace Model
{
class ALIBABACLOUD_CODEUP_EXPORT GetGroupDetailRequest : public RoaServiceRequest
{
public:
GetGroupDetailRequest();
~GetGroupDetailRequest();
std::string getOrganizationId()const;
void setOrganizationId(const std::string& organizationId);
std::string getSubUserId()const;
void setSubUserId(const std::string& subUserId);
long getGroupId()const;
void setGroupId(long groupId);
std::string getAccessToken()const;
void setAccessToken(const std::string& accessToken);
private:
std::string organizationId_;
std::string subUserId_;
long groupId_;
std::string accessToken_;
};
}
}
}
#endif // !ALIBABACLOUD_CODEUP_MODEL_GETGROUPDETAILREQUEST_H_

View File

@@ -0,0 +1,72 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ALIBABACLOUD_CODEUP_MODEL_GETGROUPDETAILRESULT_H_
#define ALIBABACLOUD_CODEUP_MODEL_GETGROUPDETAILRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/codeup/CodeupExport.h>
namespace AlibabaCloud
{
namespace Codeup
{
namespace Model
{
class ALIBABACLOUD_CODEUP_EXPORT GetGroupDetailResult : public ServiceResult
{
public:
struct Result
{
std::string path;
std::string pathWithNamespace;
long parentId;
std::string type;
std::string description;
std::string avatarUrl;
long ownerId;
std::string webUrl;
std::string nameWithNamespace;
std::string visibilityLevel;
long id;
std::string name;
};
GetGroupDetailResult();
explicit GetGroupDetailResult(const std::string &payload);
~GetGroupDetailResult();
std::string getErrorCode()const;
std::string getErrorMessage()const;
bool getSuccess()const;
Result getResult()const;
protected:
void parse(const std::string &payload);
private:
std::string errorCode_;
std::string errorMessage_;
bool success_;
Result result_;
};
}
}
}
#endif // !ALIBABACLOUD_CODEUP_MODEL_GETGROUPDETAILRESULT_H_

View File

@@ -46,6 +46,7 @@ namespace AlibabaCloud
ListGroupMemberResult();
explicit ListGroupMemberResult(const std::string &payload);
~ListGroupMemberResult();
long getTotal()const;
std::string getErrorCode()const;
std::string getErrorMessage()const;
bool getSuccess()const;
@@ -54,6 +55,7 @@ namespace AlibabaCloud
protected:
void parse(const std::string &payload);
private:
long total_;
std::string errorCode_;
std::string errorMessage_;
bool success_;

View File

@@ -56,6 +56,7 @@ namespace AlibabaCloud
ListGroupRepositoriesResult();
explicit ListGroupRepositoriesResult(const std::string &payload);
~ListGroupRepositoriesResult();
long getTotal()const;
std::string getErrorCode()const;
std::string getErrorMessage()const;
bool getSuccess()const;
@@ -64,6 +65,7 @@ namespace AlibabaCloud
protected:
void parse(const std::string &payload);
private:
long total_;
std::string errorCode_;
std::string errorMessage_;
bool success_;

View File

@@ -54,6 +54,7 @@ namespace AlibabaCloud
ListGroupsResult();
explicit ListGroupsResult(const std::string &payload);
~ListGroupsResult();
long getTotal()const;
std::string getErrorCode()const;
std::string getErrorMessage()const;
bool getSuccess()const;
@@ -62,6 +63,7 @@ namespace AlibabaCloud
protected:
void parse(const std::string &payload);
private:
long total_;
std::string errorCode_;
std::string errorMessage_;
bool success_;

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.
*/
#ifndef ALIBABACLOUD_CODEUP_MODEL_LISTREPOSITORYBRANCHESREQUEST_H_
#define ALIBABACLOUD_CODEUP_MODEL_LISTREPOSITORYBRANCHESREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RoaServiceRequest.h>
#include <alibabacloud/codeup/CodeupExport.h>
namespace AlibabaCloud
{
namespace Codeup
{
namespace Model
{
class ALIBABACLOUD_CODEUP_EXPORT ListRepositoryBranchesRequest : public RoaServiceRequest
{
public:
ListRepositoryBranchesRequest();
~ListRepositoryBranchesRequest();
std::string getOrganizationId()const;
void setOrganizationId(const std::string& organizationId);
std::string getSearch()const;
void setSearch(const std::string& search);
std::string getSubUserId()const;
void setSubUserId(const std::string& subUserId);
long getPageSize()const;
void setPageSize(long pageSize);
std::string getAccessToken()const;
void setAccessToken(const std::string& accessToken);
long getPage()const;
void setPage(long page);
long getProjectId()const;
void setProjectId(long projectId);
private:
std::string organizationId_;
std::string search_;
std::string subUserId_;
long pageSize_;
std::string accessToken_;
long page_;
long projectId_;
};
}
}
}
#endif // !ALIBABACLOUD_CODEUP_MODEL_LISTREPOSITORYBRANCHESREQUEST_H_

View File

@@ -0,0 +1,80 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ALIBABACLOUD_CODEUP_MODEL_LISTREPOSITORYBRANCHESRESULT_H_
#define ALIBABACLOUD_CODEUP_MODEL_LISTREPOSITORYBRANCHESRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/codeup/CodeupExport.h>
namespace AlibabaCloud
{
namespace Codeup
{
namespace Model
{
class ALIBABACLOUD_CODEUP_EXPORT ListRepositoryBranchesResult : public ServiceResult
{
public:
struct ResultItem
{
struct CommitInfo
{
std::string authorName;
std::string message;
std::string authorDate;
std::string committedDate;
std::string committerEmail;
std::vector<std::string> parentIds;
std::string createdAt;
std::string shortId;
std::string title;
std::string id;
std::string authorEmail;
std::string committerName;
};
bool protectedBranch;
CommitInfo commitInfo;
std::string branchName;
};
ListRepositoryBranchesResult();
explicit ListRepositoryBranchesResult(const std::string &payload);
~ListRepositoryBranchesResult();
long getTotal()const;
std::string getErrorCode()const;
std::string getErrorMessage()const;
bool getSuccess()const;
std::vector<ResultItem> getResult()const;
protected:
void parse(const std::string &payload);
private:
long total_;
std::string errorCode_;
std::string errorMessage_;
bool success_;
std::vector<ResultItem> result_;
};
}
}
}
#endif // !ALIBABACLOUD_CODEUP_MODEL_LISTREPOSITORYBRANCHESRESULT_H_

View File

@@ -46,6 +46,7 @@ namespace AlibabaCloud
ListRepositoryMemberResult();
explicit ListRepositoryMemberResult(const std::string &payload);
~ListRepositoryMemberResult();
long getTotal()const;
std::string getErrorCode()const;
std::string getErrorMessage()const;
bool getSuccess()const;
@@ -54,6 +55,7 @@ namespace AlibabaCloud
protected:
void parse(const std::string &payload);
private:
long total_;
std::string errorCode_;
std::string errorMessage_;
bool success_;

View File

@@ -699,6 +699,42 @@ CodeupClient::GetFileBlobsOutcomeCallable CodeupClient::getFileBlobsCallable(con
return task->get_future();
}
CodeupClient::GetGroupDetailOutcome CodeupClient::getGroupDetail(const GetGroupDetailRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return GetGroupDetailOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return GetGroupDetailOutcome(GetGroupDetailResult(outcome.result()));
else
return GetGroupDetailOutcome(outcome.error());
}
void CodeupClient::getGroupDetailAsync(const GetGroupDetailRequest& request, const GetGroupDetailAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, getGroupDetail(request), context);
};
asyncExecute(new Runnable(fn));
}
CodeupClient::GetGroupDetailOutcomeCallable CodeupClient::getGroupDetailCallable(const GetGroupDetailRequest &request) const
{
auto task = std::make_shared<std::packaged_task<GetGroupDetailOutcome()>>(
[this, request]()
{
return this->getGroupDetail(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
CodeupClient::GetProjectMemberOutcome CodeupClient::getProjectMember(const GetProjectMemberRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -879,6 +915,42 @@ CodeupClient::ListGroupsOutcomeCallable CodeupClient::listGroupsCallable(const L
return task->get_future();
}
CodeupClient::ListRepositoryBranchesOutcome CodeupClient::listRepositoryBranches(const ListRepositoryBranchesRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return ListRepositoryBranchesOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return ListRepositoryBranchesOutcome(ListRepositoryBranchesResult(outcome.result()));
else
return ListRepositoryBranchesOutcome(outcome.error());
}
void CodeupClient::listRepositoryBranchesAsync(const ListRepositoryBranchesRequest& request, const ListRepositoryBranchesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, listRepositoryBranches(request), context);
};
asyncExecute(new Runnable(fn));
}
CodeupClient::ListRepositoryBranchesOutcomeCallable CodeupClient::listRepositoryBranchesCallable(const ListRepositoryBranchesRequest &request) const
{
auto task = std::make_shared<std::packaged_task<ListRepositoryBranchesOutcome()>>(
[this, request]()
{
return this->listRepositoryBranches(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
CodeupClient::ListRepositoryMemberOutcome CodeupClient::listRepositoryMember(const ListRepositoryMemberRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();

View File

@@ -112,18 +112,18 @@ void CreateMergeRequestResult::parse(const std::string &payload)
satisfiedCheckResultsItemObject.checkName = approveCheckResultNodeSatisfiedCheckResultsSatisfiedCheckResultsItem["CheckName"].asString();
if(!approveCheckResultNodeSatisfiedCheckResultsSatisfiedCheckResultsItem["CheckType"].isNull())
satisfiedCheckResultsItemObject.checkType = approveCheckResultNodeSatisfiedCheckResultsSatisfiedCheckResultsItem["CheckType"].asString();
auto allExtraUsersNode = allSatisfiedCheckResultsNode["ExtraUsers"]["ExtraUsersItem"];
for (auto allSatisfiedCheckResultsNodeExtraUsersExtraUsersItem : allExtraUsersNode)
auto allExtraUsersNode = approveCheckResultNodeSatisfiedCheckResultsSatisfiedCheckResultsItem["ExtraUsers"]["ExtraUsersItem"];
for (auto approveCheckResultNodeSatisfiedCheckResultsSatisfiedCheckResultsItemExtraUsersExtraUsersItem : allExtraUsersNode)
{
Result::ApproveCheckResult::SatisfiedCheckResultsItem::ExtraUsersItem extraUsersObject;
if(!allSatisfiedCheckResultsNodeExtraUsersExtraUsersItem["Id"].isNull())
extraUsersObject.id = std::stol(allSatisfiedCheckResultsNodeExtraUsersExtraUsersItem["Id"].asString());
if(!allSatisfiedCheckResultsNodeExtraUsersExtraUsersItem["ExternUserId"].isNull())
extraUsersObject.externUserId = allSatisfiedCheckResultsNodeExtraUsersExtraUsersItem["ExternUserId"].asString();
if(!allSatisfiedCheckResultsNodeExtraUsersExtraUsersItem["AvatarUrl"].isNull())
extraUsersObject.avatarUrl = allSatisfiedCheckResultsNodeExtraUsersExtraUsersItem["AvatarUrl"].asString();
if(!allSatisfiedCheckResultsNodeExtraUsersExtraUsersItem["Name"].isNull())
extraUsersObject.name = allSatisfiedCheckResultsNodeExtraUsersExtraUsersItem["Name"].asString();
if(!approveCheckResultNodeSatisfiedCheckResultsSatisfiedCheckResultsItemExtraUsersExtraUsersItem["Id"].isNull())
extraUsersObject.id = std::stol(approveCheckResultNodeSatisfiedCheckResultsSatisfiedCheckResultsItemExtraUsersExtraUsersItem["Id"].asString());
if(!approveCheckResultNodeSatisfiedCheckResultsSatisfiedCheckResultsItemExtraUsersExtraUsersItem["ExternUserId"].isNull())
extraUsersObject.externUserId = approveCheckResultNodeSatisfiedCheckResultsSatisfiedCheckResultsItemExtraUsersExtraUsersItem["ExternUserId"].asString();
if(!approveCheckResultNodeSatisfiedCheckResultsSatisfiedCheckResultsItemExtraUsersExtraUsersItem["AvatarUrl"].isNull())
extraUsersObject.avatarUrl = approveCheckResultNodeSatisfiedCheckResultsSatisfiedCheckResultsItemExtraUsersExtraUsersItem["AvatarUrl"].asString();
if(!approveCheckResultNodeSatisfiedCheckResultsSatisfiedCheckResultsItemExtraUsersExtraUsersItem["Name"].isNull())
extraUsersObject.name = approveCheckResultNodeSatisfiedCheckResultsSatisfiedCheckResultsItemExtraUsersExtraUsersItem["Name"].asString();
satisfiedCheckResultsItemObject.extraUsers.push_back(extraUsersObject);
}
auto allSatisfiedItems = value["SatisfiedItems"]["SatisfiedItems"];
@@ -144,18 +144,18 @@ void CreateMergeRequestResult::parse(const std::string &payload)
unsatisfiedCheckResultsItemObject.checkName = approveCheckResultNodeUnsatisfiedCheckResultsUnsatisfiedCheckResultsItem["CheckName"].asString();
if(!approveCheckResultNodeUnsatisfiedCheckResultsUnsatisfiedCheckResultsItem["CheckType"].isNull())
unsatisfiedCheckResultsItemObject.checkType = approveCheckResultNodeUnsatisfiedCheckResultsUnsatisfiedCheckResultsItem["CheckType"].asString();
auto allExtraUsers3Node = allUnsatisfiedCheckResultsNode["ExtraUsers"]["ExtraUsersItem"];
for (auto allUnsatisfiedCheckResultsNodeExtraUsersExtraUsersItem : allExtraUsers3Node)
auto allExtraUsers3Node = approveCheckResultNodeUnsatisfiedCheckResultsUnsatisfiedCheckResultsItem["ExtraUsers"]["ExtraUsersItem"];
for (auto approveCheckResultNodeUnsatisfiedCheckResultsUnsatisfiedCheckResultsItemExtraUsersExtraUsersItem : allExtraUsers3Node)
{
Result::ApproveCheckResult::UnsatisfiedCheckResultsItem::ExtraUsersItem4 extraUsers3Object;
if(!allUnsatisfiedCheckResultsNodeExtraUsersExtraUsersItem["Id"].isNull())
extraUsers3Object.id = std::stol(allUnsatisfiedCheckResultsNodeExtraUsersExtraUsersItem["Id"].asString());
if(!allUnsatisfiedCheckResultsNodeExtraUsersExtraUsersItem["ExternUserId"].isNull())
extraUsers3Object.externUserId = allUnsatisfiedCheckResultsNodeExtraUsersExtraUsersItem["ExternUserId"].asString();
if(!allUnsatisfiedCheckResultsNodeExtraUsersExtraUsersItem["AvatarUrl"].isNull())
extraUsers3Object.avatarUrl = allUnsatisfiedCheckResultsNodeExtraUsersExtraUsersItem["AvatarUrl"].asString();
if(!allUnsatisfiedCheckResultsNodeExtraUsersExtraUsersItem["Name"].isNull())
extraUsers3Object.name = allUnsatisfiedCheckResultsNodeExtraUsersExtraUsersItem["Name"].asString();
if(!approveCheckResultNodeUnsatisfiedCheckResultsUnsatisfiedCheckResultsItemExtraUsersExtraUsersItem["Id"].isNull())
extraUsers3Object.id = std::stol(approveCheckResultNodeUnsatisfiedCheckResultsUnsatisfiedCheckResultsItemExtraUsersExtraUsersItem["Id"].asString());
if(!approveCheckResultNodeUnsatisfiedCheckResultsUnsatisfiedCheckResultsItemExtraUsersExtraUsersItem["ExternUserId"].isNull())
extraUsers3Object.externUserId = approveCheckResultNodeUnsatisfiedCheckResultsUnsatisfiedCheckResultsItemExtraUsersExtraUsersItem["ExternUserId"].asString();
if(!approveCheckResultNodeUnsatisfiedCheckResultsUnsatisfiedCheckResultsItemExtraUsersExtraUsersItem["AvatarUrl"].isNull())
extraUsers3Object.avatarUrl = approveCheckResultNodeUnsatisfiedCheckResultsUnsatisfiedCheckResultsItemExtraUsersExtraUsersItem["AvatarUrl"].asString();
if(!approveCheckResultNodeUnsatisfiedCheckResultsUnsatisfiedCheckResultsItemExtraUsersExtraUsersItem["Name"].isNull())
extraUsers3Object.name = approveCheckResultNodeUnsatisfiedCheckResultsUnsatisfiedCheckResultsItemExtraUsersExtraUsersItem["Name"].asString();
unsatisfiedCheckResultsItemObject.extraUsers3.push_back(extraUsers3Object);
}
auto allSatisfiedItems1 = value["SatisfiedItems"]["SatisfiedItems"];

View File

@@ -21,7 +21,7 @@ using AlibabaCloud::Codeup::Model::DeleteBranchRequest;
DeleteBranchRequest::DeleteBranchRequest() :
RoaServiceRequest("codeup", "2020-04-14")
{
setResourcePath("/api/v3/projects/[ProjectId]/repository/branches/[BranchName]");
setResourcePath("/api/v3/projects/[ProjectId]/repository/branches/delete");
setMethod(HttpRequest::Method::Delete);
}

View File

@@ -21,7 +21,7 @@ using AlibabaCloud::Codeup::Model::GetBranchInfoRequest;
GetBranchInfoRequest::GetBranchInfoRequest() :
RoaServiceRequest("codeup", "2020-04-14")
{
setResourcePath("/api/v3/projects/[ProjectId]/repository/branches/[BranchName]");
setResourcePath("/api/v3/projects/[ProjectId]/repository/branches/detail");
setMethod(HttpRequest::Method::Get);
}

View File

@@ -0,0 +1,74 @@
/*
* 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/codeup/model/GetGroupDetailRequest.h>
using AlibabaCloud::Codeup::Model::GetGroupDetailRequest;
GetGroupDetailRequest::GetGroupDetailRequest() :
RoaServiceRequest("codeup", "2020-04-14")
{
setResourcePath("/api/v3/groups/detail");
setMethod(HttpRequest::Method::Get);
}
GetGroupDetailRequest::~GetGroupDetailRequest()
{}
std::string GetGroupDetailRequest::getOrganizationId()const
{
return organizationId_;
}
void GetGroupDetailRequest::setOrganizationId(const std::string& organizationId)
{
organizationId_ = organizationId;
setParameter("OrganizationId", organizationId);
}
std::string GetGroupDetailRequest::getSubUserId()const
{
return subUserId_;
}
void GetGroupDetailRequest::setSubUserId(const std::string& subUserId)
{
subUserId_ = subUserId;
setParameter("SubUserId", subUserId);
}
long GetGroupDetailRequest::getGroupId()const
{
return groupId_;
}
void GetGroupDetailRequest::setGroupId(long groupId)
{
groupId_ = groupId;
setParameter("GroupId", std::to_string(groupId));
}
std::string GetGroupDetailRequest::getAccessToken()const
{
return accessToken_;
}
void GetGroupDetailRequest::setAccessToken(const std::string& accessToken)
{
accessToken_ = accessToken;
setParameter("AccessToken", accessToken);
}

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/codeup/model/GetGroupDetailResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Codeup;
using namespace AlibabaCloud::Codeup::Model;
GetGroupDetailResult::GetGroupDetailResult() :
ServiceResult()
{}
GetGroupDetailResult::GetGroupDetailResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
GetGroupDetailResult::~GetGroupDetailResult()
{}
void GetGroupDetailResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto resultNode = value["Result"];
if(!resultNode["Id"].isNull())
result_.id = std::stol(resultNode["Id"].asString());
if(!resultNode["Name"].isNull())
result_.name = resultNode["Name"].asString();
if(!resultNode["Path"].isNull())
result_.path = resultNode["Path"].asString();
if(!resultNode["Description"].isNull())
result_.description = resultNode["Description"].asString();
if(!resultNode["AvatarUrl"].isNull())
result_.avatarUrl = resultNode["AvatarUrl"].asString();
if(!resultNode["WebUrl"].isNull())
result_.webUrl = resultNode["WebUrl"].asString();
if(!resultNode["PathWithNamespace"].isNull())
result_.pathWithNamespace = resultNode["PathWithNamespace"].asString();
if(!resultNode["NameWithNamespace"].isNull())
result_.nameWithNamespace = resultNode["NameWithNamespace"].asString();
if(!resultNode["Type"].isNull())
result_.type = resultNode["Type"].asString();
if(!resultNode["VisibilityLevel"].isNull())
result_.visibilityLevel = resultNode["VisibilityLevel"].asString();
if(!resultNode["ParentId"].isNull())
result_.parentId = std::stol(resultNode["ParentId"].asString());
if(!resultNode["OwnerId"].isNull())
result_.ownerId = std::stol(resultNode["OwnerId"].asString());
if(!value["ErrorCode"].isNull())
errorCode_ = value["ErrorCode"].asString();
if(!value["Success"].isNull())
success_ = value["Success"].asString() == "true";
if(!value["ErrorMessage"].isNull())
errorMessage_ = value["ErrorMessage"].asString();
}
std::string GetGroupDetailResult::getErrorCode()const
{
return errorCode_;
}
std::string GetGroupDetailResult::getErrorMessage()const
{
return errorMessage_;
}
bool GetGroupDetailResult::getSuccess()const
{
return success_;
}
GetGroupDetailResult::Result GetGroupDetailResult::getResult()const
{
return result_;
}

View File

@@ -63,9 +63,16 @@ void ListGroupMemberResult::parse(const std::string &payload)
success_ = value["Success"].asString() == "true";
if(!value["ErrorMessage"].isNull())
errorMessage_ = value["ErrorMessage"].asString();
if(!value["Total"].isNull())
total_ = std::stol(value["Total"].asString());
}
long ListGroupMemberResult::getTotal()const
{
return total_;
}
std::string ListGroupMemberResult::getErrorCode()const
{
return errorCode_;

View File

@@ -83,9 +83,16 @@ void ListGroupRepositoriesResult::parse(const std::string &payload)
success_ = value["Success"].asString() == "true";
if(!value["ErrorMessage"].isNull())
errorMessage_ = value["ErrorMessage"].asString();
if(!value["Total"].isNull())
total_ = std::stol(value["Total"].asString());
}
long ListGroupRepositoriesResult::getTotal()const
{
return total_;
}
std::string ListGroupRepositoriesResult::getErrorCode()const
{
return errorCode_;

View File

@@ -79,9 +79,16 @@ void ListGroupsResult::parse(const std::string &payload)
success_ = value["Success"].asString() == "true";
if(!value["ErrorMessage"].isNull())
errorMessage_ = value["ErrorMessage"].asString();
if(!value["Total"].isNull())
total_ = std::stol(value["Total"].asString());
}
long ListGroupsResult::getTotal()const
{
return total_;
}
std::string ListGroupsResult::getErrorCode()const
{
return errorCode_;

View File

@@ -0,0 +1,107 @@
/*
* 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/codeup/model/ListRepositoryBranchesRequest.h>
using AlibabaCloud::Codeup::Model::ListRepositoryBranchesRequest;
ListRepositoryBranchesRequest::ListRepositoryBranchesRequest() :
RoaServiceRequest("codeup", "2020-04-14")
{
setResourcePath("/api/v3/projects/[ProjectId]/repository/branches");
setMethod(HttpRequest::Method::Get);
}
ListRepositoryBranchesRequest::~ListRepositoryBranchesRequest()
{}
std::string ListRepositoryBranchesRequest::getOrganizationId()const
{
return organizationId_;
}
void ListRepositoryBranchesRequest::setOrganizationId(const std::string& organizationId)
{
organizationId_ = organizationId;
setParameter("OrganizationId", organizationId);
}
std::string ListRepositoryBranchesRequest::getSearch()const
{
return search_;
}
void ListRepositoryBranchesRequest::setSearch(const std::string& search)
{
search_ = search;
setParameter("Search", search);
}
std::string ListRepositoryBranchesRequest::getSubUserId()const
{
return subUserId_;
}
void ListRepositoryBranchesRequest::setSubUserId(const std::string& subUserId)
{
subUserId_ = subUserId;
setParameter("SubUserId", subUserId);
}
long ListRepositoryBranchesRequest::getPageSize()const
{
return pageSize_;
}
void ListRepositoryBranchesRequest::setPageSize(long pageSize)
{
pageSize_ = pageSize;
setParameter("PageSize", std::to_string(pageSize));
}
std::string ListRepositoryBranchesRequest::getAccessToken()const
{
return accessToken_;
}
void ListRepositoryBranchesRequest::setAccessToken(const std::string& accessToken)
{
accessToken_ = accessToken;
setParameter("AccessToken", accessToken);
}
long ListRepositoryBranchesRequest::getPage()const
{
return page_;
}
void ListRepositoryBranchesRequest::setPage(long page)
{
page_ = page;
setParameter("Page", std::to_string(page));
}
long ListRepositoryBranchesRequest::getProjectId()const
{
return projectId_;
}
void ListRepositoryBranchesRequest::setProjectId(long projectId)
{
projectId_ = projectId;
setParameter("ProjectId", std::to_string(projectId));
}

View File

@@ -0,0 +1,113 @@
/*
* 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/codeup/model/ListRepositoryBranchesResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Codeup;
using namespace AlibabaCloud::Codeup::Model;
ListRepositoryBranchesResult::ListRepositoryBranchesResult() :
ServiceResult()
{}
ListRepositoryBranchesResult::ListRepositoryBranchesResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
ListRepositoryBranchesResult::~ListRepositoryBranchesResult()
{}
void ListRepositoryBranchesResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto allResultNode = value["Result"]["ResultItem"];
for (auto valueResultResultItem : allResultNode)
{
ResultItem resultObject;
if(!valueResultResultItem["BranchName"].isNull())
resultObject.branchName = valueResultResultItem["BranchName"].asString();
if(!valueResultResultItem["ProtectedBranch"].isNull())
resultObject.protectedBranch = valueResultResultItem["ProtectedBranch"].asString() == "true";
auto commitInfoNode = value["CommitInfo"];
if(!commitInfoNode["Id"].isNull())
resultObject.commitInfo.id = commitInfoNode["Id"].asString();
if(!commitInfoNode["ShortId"].isNull())
resultObject.commitInfo.shortId = commitInfoNode["ShortId"].asString();
if(!commitInfoNode["Title"].isNull())
resultObject.commitInfo.title = commitInfoNode["Title"].asString();
if(!commitInfoNode["AuthorName"].isNull())
resultObject.commitInfo.authorName = commitInfoNode["AuthorName"].asString();
if(!commitInfoNode["AuthorEmail"].isNull())
resultObject.commitInfo.authorEmail = commitInfoNode["AuthorEmail"].asString();
if(!commitInfoNode["CreatedAt"].isNull())
resultObject.commitInfo.createdAt = commitInfoNode["CreatedAt"].asString();
if(!commitInfoNode["Message"].isNull())
resultObject.commitInfo.message = commitInfoNode["Message"].asString();
if(!commitInfoNode["AuthorDate"].isNull())
resultObject.commitInfo.authorDate = commitInfoNode["AuthorDate"].asString();
if(!commitInfoNode["CommittedDate"].isNull())
resultObject.commitInfo.committedDate = commitInfoNode["CommittedDate"].asString();
if(!commitInfoNode["CommitterEmail"].isNull())
resultObject.commitInfo.committerEmail = commitInfoNode["CommitterEmail"].asString();
if(!commitInfoNode["CommitterName"].isNull())
resultObject.commitInfo.committerName = commitInfoNode["CommitterName"].asString();
auto allParentIds = commitInfoNode["ParentIds"]["ParentIds"];
for (auto value : allParentIds)
resultObject.commitInfo.parentIds.push_back(value.asString());
result_.push_back(resultObject);
}
if(!value["ErrorCode"].isNull())
errorCode_ = value["ErrorCode"].asString();
if(!value["Success"].isNull())
success_ = value["Success"].asString() == "true";
if(!value["ErrorMessage"].isNull())
errorMessage_ = value["ErrorMessage"].asString();
if(!value["Total"].isNull())
total_ = std::stol(value["Total"].asString());
}
long ListRepositoryBranchesResult::getTotal()const
{
return total_;
}
std::string ListRepositoryBranchesResult::getErrorCode()const
{
return errorCode_;
}
std::string ListRepositoryBranchesResult::getErrorMessage()const
{
return errorMessage_;
}
bool ListRepositoryBranchesResult::getSuccess()const
{
return success_;
}
std::vector<ListRepositoryBranchesResult::ResultItem> ListRepositoryBranchesResult::getResult()const
{
return result_;
}

View File

@@ -63,9 +63,16 @@ void ListRepositoryMemberResult::parse(const std::string &payload)
success_ = value["Success"].asString() == "true";
if(!value["ErrorMessage"].isNull())
errorMessage_ = value["ErrorMessage"].asString();
if(!value["Total"].isNull())
total_ = std::stol(value["Total"].asString());
}
long ListRepositoryMemberResult::getTotal()const
{
return total_;
}
std::string ListRepositoryMemberResult::getErrorCode()const
{
return errorCode_;

View File

@@ -112,18 +112,18 @@ void MergeMergeRequestResult::parse(const std::string &payload)
satisfiedCheckResultsItemObject.checkName = approveCheckResultNodeSatisfiedCheckResultsSatisfiedCheckResultsItem["CheckName"].asString();
if(!approveCheckResultNodeSatisfiedCheckResultsSatisfiedCheckResultsItem["CheckType"].isNull())
satisfiedCheckResultsItemObject.checkType = approveCheckResultNodeSatisfiedCheckResultsSatisfiedCheckResultsItem["CheckType"].asString();
auto allExtraUsersNode = allSatisfiedCheckResultsNode["ExtraUsers"]["ExtraUsersItem"];
for (auto allSatisfiedCheckResultsNodeExtraUsersExtraUsersItem : allExtraUsersNode)
auto allExtraUsersNode = approveCheckResultNodeSatisfiedCheckResultsSatisfiedCheckResultsItem["ExtraUsers"]["ExtraUsersItem"];
for (auto approveCheckResultNodeSatisfiedCheckResultsSatisfiedCheckResultsItemExtraUsersExtraUsersItem : allExtraUsersNode)
{
Result::ApproveCheckResult::SatisfiedCheckResultsItem::ExtraUsersItem extraUsersObject;
if(!allSatisfiedCheckResultsNodeExtraUsersExtraUsersItem["Id"].isNull())
extraUsersObject.id = std::stol(allSatisfiedCheckResultsNodeExtraUsersExtraUsersItem["Id"].asString());
if(!allSatisfiedCheckResultsNodeExtraUsersExtraUsersItem["ExternUserId"].isNull())
extraUsersObject.externUserId = allSatisfiedCheckResultsNodeExtraUsersExtraUsersItem["ExternUserId"].asString();
if(!allSatisfiedCheckResultsNodeExtraUsersExtraUsersItem["AvatarUrl"].isNull())
extraUsersObject.avatarUrl = allSatisfiedCheckResultsNodeExtraUsersExtraUsersItem["AvatarUrl"].asString();
if(!allSatisfiedCheckResultsNodeExtraUsersExtraUsersItem["Name"].isNull())
extraUsersObject.name = allSatisfiedCheckResultsNodeExtraUsersExtraUsersItem["Name"].asString();
if(!approveCheckResultNodeSatisfiedCheckResultsSatisfiedCheckResultsItemExtraUsersExtraUsersItem["Id"].isNull())
extraUsersObject.id = std::stol(approveCheckResultNodeSatisfiedCheckResultsSatisfiedCheckResultsItemExtraUsersExtraUsersItem["Id"].asString());
if(!approveCheckResultNodeSatisfiedCheckResultsSatisfiedCheckResultsItemExtraUsersExtraUsersItem["ExternUserId"].isNull())
extraUsersObject.externUserId = approveCheckResultNodeSatisfiedCheckResultsSatisfiedCheckResultsItemExtraUsersExtraUsersItem["ExternUserId"].asString();
if(!approveCheckResultNodeSatisfiedCheckResultsSatisfiedCheckResultsItemExtraUsersExtraUsersItem["AvatarUrl"].isNull())
extraUsersObject.avatarUrl = approveCheckResultNodeSatisfiedCheckResultsSatisfiedCheckResultsItemExtraUsersExtraUsersItem["AvatarUrl"].asString();
if(!approveCheckResultNodeSatisfiedCheckResultsSatisfiedCheckResultsItemExtraUsersExtraUsersItem["Name"].isNull())
extraUsersObject.name = approveCheckResultNodeSatisfiedCheckResultsSatisfiedCheckResultsItemExtraUsersExtraUsersItem["Name"].asString();
satisfiedCheckResultsItemObject.extraUsers.push_back(extraUsersObject);
}
auto allSatisfiedItems = value["SatisfiedItems"]["SatisfiedItems"];
@@ -144,18 +144,18 @@ void MergeMergeRequestResult::parse(const std::string &payload)
unsatisfiedCheckResultsItemObject.checkName = approveCheckResultNodeUnsatisfiedCheckResultsUnsatisfiedCheckResultsItem["CheckName"].asString();
if(!approveCheckResultNodeUnsatisfiedCheckResultsUnsatisfiedCheckResultsItem["CheckType"].isNull())
unsatisfiedCheckResultsItemObject.checkType = approveCheckResultNodeUnsatisfiedCheckResultsUnsatisfiedCheckResultsItem["CheckType"].asString();
auto allExtraUsers3Node = allUnsatisfiedCheckResultsNode["ExtraUsers"]["ExtraUsersItem"];
for (auto allUnsatisfiedCheckResultsNodeExtraUsersExtraUsersItem : allExtraUsers3Node)
auto allExtraUsers3Node = approveCheckResultNodeUnsatisfiedCheckResultsUnsatisfiedCheckResultsItem["ExtraUsers"]["ExtraUsersItem"];
for (auto approveCheckResultNodeUnsatisfiedCheckResultsUnsatisfiedCheckResultsItemExtraUsersExtraUsersItem : allExtraUsers3Node)
{
Result::ApproveCheckResult::UnsatisfiedCheckResultsItem::ExtraUsersItem4 extraUsers3Object;
if(!allUnsatisfiedCheckResultsNodeExtraUsersExtraUsersItem["Id"].isNull())
extraUsers3Object.id = std::stol(allUnsatisfiedCheckResultsNodeExtraUsersExtraUsersItem["Id"].asString());
if(!allUnsatisfiedCheckResultsNodeExtraUsersExtraUsersItem["ExternUserId"].isNull())
extraUsers3Object.externUserId = allUnsatisfiedCheckResultsNodeExtraUsersExtraUsersItem["ExternUserId"].asString();
if(!allUnsatisfiedCheckResultsNodeExtraUsersExtraUsersItem["AvatarUrl"].isNull())
extraUsers3Object.avatarUrl = allUnsatisfiedCheckResultsNodeExtraUsersExtraUsersItem["AvatarUrl"].asString();
if(!allUnsatisfiedCheckResultsNodeExtraUsersExtraUsersItem["Name"].isNull())
extraUsers3Object.name = allUnsatisfiedCheckResultsNodeExtraUsersExtraUsersItem["Name"].asString();
if(!approveCheckResultNodeUnsatisfiedCheckResultsUnsatisfiedCheckResultsItemExtraUsersExtraUsersItem["Id"].isNull())
extraUsers3Object.id = std::stol(approveCheckResultNodeUnsatisfiedCheckResultsUnsatisfiedCheckResultsItemExtraUsersExtraUsersItem["Id"].asString());
if(!approveCheckResultNodeUnsatisfiedCheckResultsUnsatisfiedCheckResultsItemExtraUsersExtraUsersItem["ExternUserId"].isNull())
extraUsers3Object.externUserId = approveCheckResultNodeUnsatisfiedCheckResultsUnsatisfiedCheckResultsItemExtraUsersExtraUsersItem["ExternUserId"].asString();
if(!approveCheckResultNodeUnsatisfiedCheckResultsUnsatisfiedCheckResultsItemExtraUsersExtraUsersItem["AvatarUrl"].isNull())
extraUsers3Object.avatarUrl = approveCheckResultNodeUnsatisfiedCheckResultsUnsatisfiedCheckResultsItemExtraUsersExtraUsersItem["AvatarUrl"].asString();
if(!approveCheckResultNodeUnsatisfiedCheckResultsUnsatisfiedCheckResultsItemExtraUsersExtraUsersItem["Name"].isNull())
extraUsers3Object.name = approveCheckResultNodeUnsatisfiedCheckResultsUnsatisfiedCheckResultsItemExtraUsersExtraUsersItem["Name"].asString();
unsatisfiedCheckResultsItemObject.extraUsers3.push_back(extraUsers3Object);
}
auto allSatisfiedItems1 = value["SatisfiedItems"]["SatisfiedItems"];

View File

@@ -31,6 +31,8 @@ set(facebody_public_header_model
include/alibabacloud/facebody/model/BodyPostureResult.h
include/alibabacloud/facebody/model/CompareFaceRequest.h
include/alibabacloud/facebody/model/CompareFaceResult.h
include/alibabacloud/facebody/model/CountCrowdRequest.h
include/alibabacloud/facebody/model/CountCrowdResult.h
include/alibabacloud/facebody/model/CreateFaceDbRequest.h
include/alibabacloud/facebody/model/CreateFaceDbResult.h
include/alibabacloud/facebody/model/DeleteFaceRequest.h
@@ -71,6 +73,8 @@ set(facebody_public_header_model
include/alibabacloud/facebody/model/FaceMakeupResult.h
include/alibabacloud/facebody/model/FaceTidyupRequest.h
include/alibabacloud/facebody/model/FaceTidyupResult.h
include/alibabacloud/facebody/model/GenerateHumanAnimeStyleRequest.h
include/alibabacloud/facebody/model/GenerateHumanAnimeStyleResult.h
include/alibabacloud/facebody/model/GetFaceEntityRequest.h
include/alibabacloud/facebody/model/GetFaceEntityResult.h
include/alibabacloud/facebody/model/HandPostureRequest.h
@@ -110,6 +114,8 @@ set(facebody_src
src/model/BodyPostureResult.cc
src/model/CompareFaceRequest.cc
src/model/CompareFaceResult.cc
src/model/CountCrowdRequest.cc
src/model/CountCrowdResult.cc
src/model/CreateFaceDbRequest.cc
src/model/CreateFaceDbResult.cc
src/model/DeleteFaceRequest.cc
@@ -150,6 +156,8 @@ set(facebody_src
src/model/FaceMakeupResult.cc
src/model/FaceTidyupRequest.cc
src/model/FaceTidyupResult.cc
src/model/GenerateHumanAnimeStyleRequest.cc
src/model/GenerateHumanAnimeStyleResult.cc
src/model/GetFaceEntityRequest.cc
src/model/GetFaceEntityResult.cc
src/model/HandPostureRequest.cc

View File

@@ -32,6 +32,8 @@
#include "model/BodyPostureResult.h"
#include "model/CompareFaceRequest.h"
#include "model/CompareFaceResult.h"
#include "model/CountCrowdRequest.h"
#include "model/CountCrowdResult.h"
#include "model/CreateFaceDbRequest.h"
#include "model/CreateFaceDbResult.h"
#include "model/DeleteFaceRequest.h"
@@ -72,6 +74,8 @@
#include "model/FaceMakeupResult.h"
#include "model/FaceTidyupRequest.h"
#include "model/FaceTidyupResult.h"
#include "model/GenerateHumanAnimeStyleRequest.h"
#include "model/GenerateHumanAnimeStyleResult.h"
#include "model/GetFaceEntityRequest.h"
#include "model/GetFaceEntityResult.h"
#include "model/HandPostureRequest.h"
@@ -122,6 +126,9 @@ namespace AlibabaCloud
typedef Outcome<Error, Model::CompareFaceResult> CompareFaceOutcome;
typedef std::future<CompareFaceOutcome> CompareFaceOutcomeCallable;
typedef std::function<void(const FacebodyClient*, const Model::CompareFaceRequest&, const CompareFaceOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> CompareFaceAsyncHandler;
typedef Outcome<Error, Model::CountCrowdResult> CountCrowdOutcome;
typedef std::future<CountCrowdOutcome> CountCrowdOutcomeCallable;
typedef std::function<void(const FacebodyClient*, const Model::CountCrowdRequest&, const CountCrowdOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> CountCrowdAsyncHandler;
typedef Outcome<Error, Model::CreateFaceDbResult> CreateFaceDbOutcome;
typedef std::future<CreateFaceDbOutcome> CreateFaceDbOutcomeCallable;
typedef std::function<void(const FacebodyClient*, const Model::CreateFaceDbRequest&, const CreateFaceDbOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> CreateFaceDbAsyncHandler;
@@ -182,6 +189,9 @@ namespace AlibabaCloud
typedef Outcome<Error, Model::FaceTidyupResult> FaceTidyupOutcome;
typedef std::future<FaceTidyupOutcome> FaceTidyupOutcomeCallable;
typedef std::function<void(const FacebodyClient*, const Model::FaceTidyupRequest&, const FaceTidyupOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> FaceTidyupAsyncHandler;
typedef Outcome<Error, Model::GenerateHumanAnimeStyleResult> GenerateHumanAnimeStyleOutcome;
typedef std::future<GenerateHumanAnimeStyleOutcome> GenerateHumanAnimeStyleOutcomeCallable;
typedef std::function<void(const FacebodyClient*, const Model::GenerateHumanAnimeStyleRequest&, const GenerateHumanAnimeStyleOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GenerateHumanAnimeStyleAsyncHandler;
typedef Outcome<Error, Model::GetFaceEntityResult> GetFaceEntityOutcome;
typedef std::future<GetFaceEntityOutcome> GetFaceEntityOutcomeCallable;
typedef std::function<void(const FacebodyClient*, const Model::GetFaceEntityRequest&, const GetFaceEntityOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetFaceEntityAsyncHandler;
@@ -241,6 +251,9 @@ namespace AlibabaCloud
CompareFaceOutcome compareFace(const Model::CompareFaceRequest &request)const;
void compareFaceAsync(const Model::CompareFaceRequest& request, const CompareFaceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
CompareFaceOutcomeCallable compareFaceCallable(const Model::CompareFaceRequest& request) const;
CountCrowdOutcome countCrowd(const Model::CountCrowdRequest &request)const;
void countCrowdAsync(const Model::CountCrowdRequest& request, const CountCrowdAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
CountCrowdOutcomeCallable countCrowdCallable(const Model::CountCrowdRequest& request) const;
CreateFaceDbOutcome createFaceDb(const Model::CreateFaceDbRequest &request)const;
void createFaceDbAsync(const Model::CreateFaceDbRequest& request, const CreateFaceDbAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
CreateFaceDbOutcomeCallable createFaceDbCallable(const Model::CreateFaceDbRequest& request) const;
@@ -301,6 +314,9 @@ namespace AlibabaCloud
FaceTidyupOutcome faceTidyup(const Model::FaceTidyupRequest &request)const;
void faceTidyupAsync(const Model::FaceTidyupRequest& request, const FaceTidyupAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
FaceTidyupOutcomeCallable faceTidyupCallable(const Model::FaceTidyupRequest& request) const;
GenerateHumanAnimeStyleOutcome generateHumanAnimeStyle(const Model::GenerateHumanAnimeStyleRequest &request)const;
void generateHumanAnimeStyleAsync(const Model::GenerateHumanAnimeStyleRequest& request, const GenerateHumanAnimeStyleAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
GenerateHumanAnimeStyleOutcomeCallable generateHumanAnimeStyleCallable(const Model::GenerateHumanAnimeStyleRequest& request) const;
GetFaceEntityOutcome getFaceEntity(const Model::GetFaceEntityRequest &request)const;
void getFaceEntityAsync(const Model::GetFaceEntityRequest& request, const GetFaceEntityAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
GetFaceEntityOutcomeCallable getFaceEntityCallable(const Model::GetFaceEntityRequest& request) const;

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_FACEBODY_MODEL_COUNTCROWDREQUEST_H_
#define ALIBABACLOUD_FACEBODY_MODEL_COUNTCROWDREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/facebody/FacebodyExport.h>
namespace AlibabaCloud
{
namespace Facebody
{
namespace Model
{
class ALIBABACLOUD_FACEBODY_EXPORT CountCrowdRequest : public RpcServiceRequest
{
public:
CountCrowdRequest();
~CountCrowdRequest();
bool getIsShow()const;
void setIsShow(bool isShow);
std::string getImageURL()const;
void setImageURL(const std::string& imageURL);
private:
bool isShow_;
std::string imageURL_;
};
}
}
}
#endif // !ALIBABACLOUD_FACEBODY_MODEL_COUNTCROWDREQUEST_H_

View File

@@ -0,0 +1,56 @@
/*
* 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_FACEBODY_MODEL_COUNTCROWDRESULT_H_
#define ALIBABACLOUD_FACEBODY_MODEL_COUNTCROWDRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/facebody/FacebodyExport.h>
namespace AlibabaCloud
{
namespace Facebody
{
namespace Model
{
class ALIBABACLOUD_FACEBODY_EXPORT CountCrowdResult : public ServiceResult
{
public:
struct Data
{
int peopleNumber;
std::string hotMap;
};
CountCrowdResult();
explicit CountCrowdResult(const std::string &payload);
~CountCrowdResult();
Data getData()const;
protected:
void parse(const std::string &payload);
private:
Data data_;
};
}
}
}
#endif // !ALIBABACLOUD_FACEBODY_MODEL_COUNTCROWDRESULT_H_

View File

@@ -30,17 +30,25 @@ namespace AlibabaCloud
{
class ALIBABACLOUD_FACEBODY_EXPORT ExtractPedestrianFeatureAttributeRequest : public RpcServiceRequest
{
public:
struct UrlList
{
std::string url;
};
public:
ExtractPedestrianFeatureAttributeRequest();
~ExtractPedestrianFeatureAttributeRequest();
std::vector<UrlList> getUrlList()const;
void setUrlList(const std::vector<UrlList>& urlList);
std::string getMode()const;
void setMode(const std::string& mode);
std::string getImageURL()const;
void setImageURL(const std::string& imageURL);
private:
std::vector<UrlList> urlList_;
std::string mode_;
std::string imageURL_;

View File

@@ -34,12 +34,34 @@ namespace AlibabaCloud
public:
struct Data
{
struct Element
{
std::string hair;
std::string upperType;
float upperTypeScore;
float qualityScore;
std::string lowerColor;
std::string gender;
std::string feature;
float upperColorScore;
float lowerColorScore;
float genderScore;
std::string objType;
float lowerTypeScore;
float hairScore;
std::string upperColor;
std::string lowerType;
float ageScore;
float objTypeScore;
std::string age;
};
std::string hair;
std::string upperType;
float upperTypeScore;
float qualityScore;
std::string lowerColor;
std::string gender;
std::vector<Element> elements;
std::string feature;
float upperColorScore;
float lowerColorScore;

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_FACEBODY_MODEL_GENERATEHUMANANIMESTYLEREQUEST_H_
#define ALIBABACLOUD_FACEBODY_MODEL_GENERATEHUMANANIMESTYLEREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/facebody/FacebodyExport.h>
namespace AlibabaCloud
{
namespace Facebody
{
namespace Model
{
class ALIBABACLOUD_FACEBODY_EXPORT GenerateHumanAnimeStyleRequest : public RpcServiceRequest
{
public:
GenerateHumanAnimeStyleRequest();
~GenerateHumanAnimeStyleRequest();
std::string getImageURL()const;
void setImageURL(const std::string& imageURL);
private:
std::string imageURL_;
};
}
}
}
#endif // !ALIBABACLOUD_FACEBODY_MODEL_GENERATEHUMANANIMESTYLEREQUEST_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_FACEBODY_MODEL_GENERATEHUMANANIMESTYLERESULT_H_
#define ALIBABACLOUD_FACEBODY_MODEL_GENERATEHUMANANIMESTYLERESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/facebody/FacebodyExport.h>
namespace AlibabaCloud
{
namespace Facebody
{
namespace Model
{
class ALIBABACLOUD_FACEBODY_EXPORT GenerateHumanAnimeStyleResult : public ServiceResult
{
public:
struct Data
{
std::string imageURL;
};
GenerateHumanAnimeStyleResult();
explicit GenerateHumanAnimeStyleResult(const std::string &payload);
~GenerateHumanAnimeStyleResult();
Data getData()const;
protected:
void parse(const std::string &payload);
private:
Data data_;
};
}
}
}
#endif // !ALIBABACLOUD_FACEBODY_MODEL_GENERATEHUMANANIMESTYLERESULT_H_

View File

@@ -231,6 +231,42 @@ FacebodyClient::CompareFaceOutcomeCallable FacebodyClient::compareFaceCallable(c
return task->get_future();
}
FacebodyClient::CountCrowdOutcome FacebodyClient::countCrowd(const CountCrowdRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return CountCrowdOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return CountCrowdOutcome(CountCrowdResult(outcome.result()));
else
return CountCrowdOutcome(outcome.error());
}
void FacebodyClient::countCrowdAsync(const CountCrowdRequest& request, const CountCrowdAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, countCrowd(request), context);
};
asyncExecute(new Runnable(fn));
}
FacebodyClient::CountCrowdOutcomeCallable FacebodyClient::countCrowdCallable(const CountCrowdRequest &request) const
{
auto task = std::make_shared<std::packaged_task<CountCrowdOutcome()>>(
[this, request]()
{
return this->countCrowd(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
FacebodyClient::CreateFaceDbOutcome FacebodyClient::createFaceDb(const CreateFaceDbRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -951,6 +987,42 @@ FacebodyClient::FaceTidyupOutcomeCallable FacebodyClient::faceTidyupCallable(con
return task->get_future();
}
FacebodyClient::GenerateHumanAnimeStyleOutcome FacebodyClient::generateHumanAnimeStyle(const GenerateHumanAnimeStyleRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return GenerateHumanAnimeStyleOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return GenerateHumanAnimeStyleOutcome(GenerateHumanAnimeStyleResult(outcome.result()));
else
return GenerateHumanAnimeStyleOutcome(outcome.error());
}
void FacebodyClient::generateHumanAnimeStyleAsync(const GenerateHumanAnimeStyleRequest& request, const GenerateHumanAnimeStyleAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, generateHumanAnimeStyle(request), context);
};
asyncExecute(new Runnable(fn));
}
FacebodyClient::GenerateHumanAnimeStyleOutcomeCallable FacebodyClient::generateHumanAnimeStyleCallable(const GenerateHumanAnimeStyleRequest &request) const
{
auto task = std::make_shared<std::packaged_task<GenerateHumanAnimeStyleOutcome()>>(
[this, request]()
{
return this->generateHumanAnimeStyle(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
FacebodyClient::GetFaceEntityOutcome FacebodyClient::getFaceEntity(const GetFaceEntityRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();

View File

@@ -46,20 +46,20 @@ void BodyPostureResult::parse(const std::string &payload)
Data::Output outputObject;
if(!dataNodeOutputsOutput["HumanCount"].isNull())
outputObject.humanCount = std::stoi(dataNodeOutputsOutput["HumanCount"].asString());
auto allResultsNode = allOutputsNode["Results"]["Result"];
for (auto allOutputsNodeResultsResult : allResultsNode)
auto allResultsNode = dataNodeOutputsOutput["Results"]["Result"];
for (auto dataNodeOutputsOutputResultsResult : allResultsNode)
{
Data::Output::Result resultsObject;
auto allBodiesNode = allResultsNode["Bodies"]["Body"];
for (auto allResultsNodeBodiesBody : allBodiesNode)
auto allBodiesNode = dataNodeOutputsOutputResultsResult["Bodies"]["Body"];
for (auto dataNodeOutputsOutputResultsResultBodiesBody : allBodiesNode)
{
Data::Output::Result::Body bodiesObject;
if(!allResultsNodeBodiesBody["Confident"].isNull())
bodiesObject.confident = std::stof(allResultsNodeBodiesBody["Confident"].asString());
if(!allResultsNodeBodiesBody["Label"].isNull())
bodiesObject.label = allResultsNodeBodiesBody["Label"].asString();
auto allPositionsNode = allBodiesNode["Positions"]["Position"];
for (auto allBodiesNodePositionsPosition : allPositionsNode)
if(!dataNodeOutputsOutputResultsResultBodiesBody["Confident"].isNull())
bodiesObject.confident = std::stof(dataNodeOutputsOutputResultsResultBodiesBody["Confident"].asString());
if(!dataNodeOutputsOutputResultsResultBodiesBody["Label"].isNull())
bodiesObject.label = dataNodeOutputsOutputResultsResultBodiesBody["Label"].asString();
auto allPositionsNode = dataNodeOutputsOutputResultsResultBodiesBody["Positions"]["Position"];
for (auto dataNodeOutputsOutputResultsResultBodiesBodyPositionsPosition : allPositionsNode)
{
Data::Output::Result::Body::Position positionsObject;
auto allPoints = value["Points"]["Point"];

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/facebody/model/CountCrowdRequest.h>
using AlibabaCloud::Facebody::Model::CountCrowdRequest;
CountCrowdRequest::CountCrowdRequest() :
RpcServiceRequest("facebody", "2019-12-30", "CountCrowd")
{
setMethod(HttpRequest::Method::Post);
}
CountCrowdRequest::~CountCrowdRequest()
{}
bool CountCrowdRequest::getIsShow()const
{
return isShow_;
}
void CountCrowdRequest::setIsShow(bool isShow)
{
isShow_ = isShow;
setBodyParameter("IsShow", isShow ? "true" : "false");
}
std::string CountCrowdRequest::getImageURL()const
{
return imageURL_;
}
void CountCrowdRequest::setImageURL(const std::string& imageURL)
{
imageURL_ = imageURL;
setBodyParameter("ImageURL", imageURL);
}

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.
*/
#include <alibabacloud/facebody/model/CountCrowdResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Facebody;
using namespace AlibabaCloud::Facebody::Model;
CountCrowdResult::CountCrowdResult() :
ServiceResult()
{}
CountCrowdResult::CountCrowdResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
CountCrowdResult::~CountCrowdResult()
{}
void CountCrowdResult::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["PeopleNumber"].isNull())
data_.peopleNumber = std::stoi(dataNode["PeopleNumber"].asString());
if(!dataNode["HotMap"].isNull())
data_.hotMap = dataNode["HotMap"].asString();
}
CountCrowdResult::Data CountCrowdResult::getData()const
{
return data_;
}

View File

@@ -50,12 +50,12 @@ void DetectIPCPedestrianResult::parse(const std::string &payload)
imageInfoListItemObject.errorMessage = dataNodeImageInfoListImageInfoListItem["ErrorMessage"].asString();
if(!dataNodeImageInfoListImageInfoListItem["DataId"].isNull())
imageInfoListItemObject.dataId = dataNodeImageInfoListImageInfoListItem["DataId"].asString();
auto allElementsNode = allImageInfoListNode["Elements"]["Element"];
for (auto allImageInfoListNodeElementsElement : allElementsNode)
auto allElementsNode = dataNodeImageInfoListImageInfoListItem["Elements"]["Element"];
for (auto dataNodeImageInfoListImageInfoListItemElementsElement : allElementsNode)
{
Data::ImageInfoListItem::Element elementsObject;
if(!allImageInfoListNodeElementsElement["Score"].isNull())
elementsObject.score = std::stof(allImageInfoListNodeElementsElement["Score"].asString());
if(!dataNodeImageInfoListImageInfoListItemElementsElement["Score"].isNull())
elementsObject.score = std::stof(dataNodeImageInfoListImageInfoListItemElementsElement["Score"].asString());
auto allBoxes = value["Boxes"]["Box"];
for (auto value : allBoxes)
elementsObject.boxes.push_back(value.asString());

View File

@@ -48,24 +48,24 @@ void DetectLivingFaceResult::parse(const std::string &payload)
elementObject.taskId = dataNodeElementsElement["TaskId"].asString();
if(!dataNodeElementsElement["ImageURL"].isNull())
elementObject.imageURL = dataNodeElementsElement["ImageURL"].asString();
auto allResultsNode = allElementsNode["Results"]["Result"];
for (auto allElementsNodeResultsResult : allResultsNode)
auto allResultsNode = dataNodeElementsElement["Results"]["Result"];
for (auto dataNodeElementsElementResultsResult : allResultsNode)
{
Data::Element::Result resultsObject;
if(!allElementsNodeResultsResult["Label"].isNull())
resultsObject.label = allElementsNodeResultsResult["Label"].asString();
if(!allElementsNodeResultsResult["Suggestion"].isNull())
resultsObject.suggestion = allElementsNodeResultsResult["Suggestion"].asString();
if(!allElementsNodeResultsResult["Rate"].isNull())
resultsObject.rate = std::stof(allElementsNodeResultsResult["Rate"].asString());
auto allFramesNode = allResultsNode["Frames"]["Frame"];
for (auto allResultsNodeFramesFrame : allFramesNode)
if(!dataNodeElementsElementResultsResult["Label"].isNull())
resultsObject.label = dataNodeElementsElementResultsResult["Label"].asString();
if(!dataNodeElementsElementResultsResult["Suggestion"].isNull())
resultsObject.suggestion = dataNodeElementsElementResultsResult["Suggestion"].asString();
if(!dataNodeElementsElementResultsResult["Rate"].isNull())
resultsObject.rate = std::stof(dataNodeElementsElementResultsResult["Rate"].asString());
auto allFramesNode = dataNodeElementsElementResultsResult["Frames"]["Frame"];
for (auto dataNodeElementsElementResultsResultFramesFrame : allFramesNode)
{
Data::Element::Result::Frame framesObject;
if(!allResultsNodeFramesFrame["Rate"].isNull())
framesObject.rate = std::stof(allResultsNodeFramesFrame["Rate"].asString());
if(!allResultsNodeFramesFrame["Url"].isNull())
framesObject.url = allResultsNodeFramesFrame["Url"].asString();
if(!dataNodeElementsElementResultsResultFramesFrame["Rate"].isNull())
framesObject.rate = std::stof(dataNodeElementsElementResultsResultFramesFrame["Rate"].asString());
if(!dataNodeElementsElementResultsResultFramesFrame["Url"].isNull())
framesObject.url = dataNodeElementsElementResultsResultFramesFrame["Url"].asString();
resultsObject.frames.push_back(framesObject);
}
elementObject.results.push_back(resultsObject);

View File

@@ -27,6 +27,21 @@ ExtractPedestrianFeatureAttributeRequest::ExtractPedestrianFeatureAttributeReque
ExtractPedestrianFeatureAttributeRequest::~ExtractPedestrianFeatureAttributeRequest()
{}
std::vector<ExtractPedestrianFeatureAttributeRequest::UrlList> ExtractPedestrianFeatureAttributeRequest::getUrlList()const
{
return urlList_;
}
void ExtractPedestrianFeatureAttributeRequest::setUrlList(const std::vector<UrlList>& urlList)
{
urlList_ = urlList;
for(int dep1 = 0; dep1!= urlList.size(); dep1++) {
auto urlListObj = urlList.at(dep1);
std::string urlListObjStr = "UrlList." + std::to_string(dep1 + 1);
setParameter(urlListObjStr + ".Url", urlListObj.url);
}
}
std::string ExtractPedestrianFeatureAttributeRequest::getMode()const
{
return mode_;

View File

@@ -76,6 +76,48 @@ void ExtractPedestrianFeatureAttributeResult::parse(const std::string &payload)
data_.age = dataNode["Age"].asString();
if(!dataNode["AgeScore"].isNull())
data_.ageScore = std::stof(dataNode["AgeScore"].asString());
auto allElementsNode = dataNode["Elements"]["Element"];
for (auto dataNodeElementsElement : allElementsNode)
{
Data::Element elementObject;
if(!dataNodeElementsElement["ObjType"].isNull())
elementObject.objType = dataNodeElementsElement["ObjType"].asString();
if(!dataNodeElementsElement["ObjTypeScore"].isNull())
elementObject.objTypeScore = std::stof(dataNodeElementsElement["ObjTypeScore"].asString());
if(!dataNodeElementsElement["Feature"].isNull())
elementObject.feature = dataNodeElementsElement["Feature"].asString();
if(!dataNodeElementsElement["QualityScore"].isNull())
elementObject.qualityScore = std::stof(dataNodeElementsElement["QualityScore"].asString());
if(!dataNodeElementsElement["UpperColor"].isNull())
elementObject.upperColor = dataNodeElementsElement["UpperColor"].asString();
if(!dataNodeElementsElement["UpperColorScore"].isNull())
elementObject.upperColorScore = std::stof(dataNodeElementsElement["UpperColorScore"].asString());
if(!dataNodeElementsElement["UpperType"].isNull())
elementObject.upperType = dataNodeElementsElement["UpperType"].asString();
if(!dataNodeElementsElement["UpperTypeScore"].isNull())
elementObject.upperTypeScore = std::stof(dataNodeElementsElement["UpperTypeScore"].asString());
if(!dataNodeElementsElement["LowerColor"].isNull())
elementObject.lowerColor = dataNodeElementsElement["LowerColor"].asString();
if(!dataNodeElementsElement["LowerColorScore"].isNull())
elementObject.lowerColorScore = std::stof(dataNodeElementsElement["LowerColorScore"].asString());
if(!dataNodeElementsElement["LowerType"].isNull())
elementObject.lowerType = dataNodeElementsElement["LowerType"].asString();
if(!dataNodeElementsElement["LowerTypeScore"].isNull())
elementObject.lowerTypeScore = std::stof(dataNodeElementsElement["LowerTypeScore"].asString());
if(!dataNodeElementsElement["Gender"].isNull())
elementObject.gender = dataNodeElementsElement["Gender"].asString();
if(!dataNodeElementsElement["GenderScore"].isNull())
elementObject.genderScore = std::stof(dataNodeElementsElement["GenderScore"].asString());
if(!dataNodeElementsElement["Hair"].isNull())
elementObject.hair = dataNodeElementsElement["Hair"].asString();
if(!dataNodeElementsElement["HairScore"].isNull())
elementObject.hairScore = std::stof(dataNodeElementsElement["HairScore"].asString());
if(!dataNodeElementsElement["Age"].isNull())
elementObject.age = dataNodeElementsElement["Age"].asString();
if(!dataNodeElementsElement["AgeScore"].isNull())
elementObject.ageScore = std::stof(dataNodeElementsElement["AgeScore"].asString());
data_.elements.push_back(elementObject);
}
}

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/facebody/model/GenerateHumanAnimeStyleRequest.h>
using AlibabaCloud::Facebody::Model::GenerateHumanAnimeStyleRequest;
GenerateHumanAnimeStyleRequest::GenerateHumanAnimeStyleRequest() :
RpcServiceRequest("facebody", "2019-12-30", "GenerateHumanAnimeStyle")
{
setMethod(HttpRequest::Method::Post);
}
GenerateHumanAnimeStyleRequest::~GenerateHumanAnimeStyleRequest()
{}
std::string GenerateHumanAnimeStyleRequest::getImageURL()const
{
return imageURL_;
}
void GenerateHumanAnimeStyleRequest::setImageURL(const std::string& imageURL)
{
imageURL_ = imageURL;
setBodyParameter("ImageURL", imageURL);
}

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/facebody/model/GenerateHumanAnimeStyleResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Facebody;
using namespace AlibabaCloud::Facebody::Model;
GenerateHumanAnimeStyleResult::GenerateHumanAnimeStyleResult() :
ServiceResult()
{}
GenerateHumanAnimeStyleResult::GenerateHumanAnimeStyleResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
GenerateHumanAnimeStyleResult::~GenerateHumanAnimeStyleResult()
{}
void GenerateHumanAnimeStyleResult::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["ImageURL"].isNull())
data_.imageURL = dataNode["ImageURL"].asString();
}
GenerateHumanAnimeStyleResult::Data GenerateHumanAnimeStyleResult::getData()const
{
return data_;
}

View File

@@ -46,8 +46,8 @@ void HandPostureResult::parse(const std::string &payload)
Data::Output outputObject;
if(!dataNodeOutputsOutput["HandCount"].isNull())
outputObject.handCount = std::stoi(dataNodeOutputsOutput["HandCount"].asString());
auto allResultsNode = allOutputsNode["Results"]["Result"];
for (auto allOutputsNodeResultsResult : allResultsNode)
auto allResultsNode = dataNodeOutputsOutput["Results"]["Result"];
for (auto dataNodeOutputsOutputResultsResult : allResultsNode)
{
Data::Output::Result resultsObject;
auto boxNode = value["Box"];
@@ -71,8 +71,8 @@ void HandPostureResult::parse(const std::string &payload)
Data::Output::Result::Hands::KeyPoint keyPointObject;
if(!handsNodeKeyPointsKeyPoint["Label"].isNull())
keyPointObject.label = handsNodeKeyPointsKeyPoint["Label"].asString();
auto allPositions1Node = allKeyPointsNode["Positions"]["Position"];
for (auto allKeyPointsNodePositionsPosition : allPositions1Node)
auto allPositions1Node = handsNodeKeyPointsKeyPoint["Positions"]["Position"];
for (auto handsNodeKeyPointsKeyPointPositionsPosition : allPositions1Node)
{
Data::Output::Result::Hands::KeyPoint::Position2 positions1Object;
auto allPoints3 = value["Points"]["Point"];

View File

@@ -46,8 +46,8 @@ void RecognizeActionResult::parse(const std::string &payload)
Data::Element elementObject;
if(!dataNodeElementsElement["Timestamp"].isNull())
elementObject.timestamp = std::stoi(dataNodeElementsElement["Timestamp"].asString());
auto allBoxesNode = allElementsNode["Boxes"]["BoxesItem"];
for (auto allElementsNodeBoxesBoxesItem : allBoxesNode)
auto allBoxesNode = dataNodeElementsElement["Boxes"]["BoxesItem"];
for (auto dataNodeElementsElementBoxesBoxesItem : allBoxesNode)
{
Data::Element::BoxesItem boxesObject;
auto allBox = value["Box"]["Box"];

View File

@@ -48,38 +48,38 @@ void RecognizePublicFaceResult::parse(const std::string &payload)
elementObject.taskId = dataNodeElementsElement["TaskId"].asString();
if(!dataNodeElementsElement["ImageURL"].isNull())
elementObject.imageURL = dataNodeElementsElement["ImageURL"].asString();
auto allResultsNode = allElementsNode["Results"]["Result"];
for (auto allElementsNodeResultsResult : allResultsNode)
auto allResultsNode = dataNodeElementsElement["Results"]["Result"];
for (auto dataNodeElementsElementResultsResult : allResultsNode)
{
Data::Element::Result resultsObject;
if(!allElementsNodeResultsResult["Label"].isNull())
resultsObject.label = allElementsNodeResultsResult["Label"].asString();
if(!allElementsNodeResultsResult["Suggestion"].isNull())
resultsObject.suggestion = allElementsNodeResultsResult["Suggestion"].asString();
if(!allElementsNodeResultsResult["Rate"].isNull())
resultsObject.rate = std::stof(allElementsNodeResultsResult["Rate"].asString());
auto allSubResultsNode = allResultsNode["SubResults"]["SubResult"];
for (auto allResultsNodeSubResultsSubResult : allSubResultsNode)
if(!dataNodeElementsElementResultsResult["Label"].isNull())
resultsObject.label = dataNodeElementsElementResultsResult["Label"].asString();
if(!dataNodeElementsElementResultsResult["Suggestion"].isNull())
resultsObject.suggestion = dataNodeElementsElementResultsResult["Suggestion"].asString();
if(!dataNodeElementsElementResultsResult["Rate"].isNull())
resultsObject.rate = std::stof(dataNodeElementsElementResultsResult["Rate"].asString());
auto allSubResultsNode = dataNodeElementsElementResultsResult["SubResults"]["SubResult"];
for (auto dataNodeElementsElementResultsResultSubResultsSubResult : allSubResultsNode)
{
Data::Element::Result::SubResult subResultsObject;
if(!allResultsNodeSubResultsSubResult["H"].isNull())
subResultsObject.h = std::stof(allResultsNodeSubResultsSubResult["H"].asString());
if(!allResultsNodeSubResultsSubResult["W"].isNull())
subResultsObject.w = std::stof(allResultsNodeSubResultsSubResult["W"].asString());
if(!allResultsNodeSubResultsSubResult["X"].isNull())
subResultsObject.x = std::stof(allResultsNodeSubResultsSubResult["X"].asString());
if(!allResultsNodeSubResultsSubResult["Y"].isNull())
subResultsObject.y = std::stof(allResultsNodeSubResultsSubResult["Y"].asString());
auto allFacesNode = allSubResultsNode["Faces"]["Face"];
for (auto allSubResultsNodeFacesFace : allFacesNode)
if(!dataNodeElementsElementResultsResultSubResultsSubResult["H"].isNull())
subResultsObject.h = std::stof(dataNodeElementsElementResultsResultSubResultsSubResult["H"].asString());
if(!dataNodeElementsElementResultsResultSubResultsSubResult["W"].isNull())
subResultsObject.w = std::stof(dataNodeElementsElementResultsResultSubResultsSubResult["W"].asString());
if(!dataNodeElementsElementResultsResultSubResultsSubResult["X"].isNull())
subResultsObject.x = std::stof(dataNodeElementsElementResultsResultSubResultsSubResult["X"].asString());
if(!dataNodeElementsElementResultsResultSubResultsSubResult["Y"].isNull())
subResultsObject.y = std::stof(dataNodeElementsElementResultsResultSubResultsSubResult["Y"].asString());
auto allFacesNode = dataNodeElementsElementResultsResultSubResultsSubResult["Faces"]["Face"];
for (auto dataNodeElementsElementResultsResultSubResultsSubResultFacesFace : allFacesNode)
{
Data::Element::Result::SubResult::Face facesObject;
if(!allSubResultsNodeFacesFace["Id"].isNull())
facesObject.id = allSubResultsNodeFacesFace["Id"].asString();
if(!allSubResultsNodeFacesFace["Name"].isNull())
facesObject.name = allSubResultsNodeFacesFace["Name"].asString();
if(!allSubResultsNodeFacesFace["Rate"].isNull())
facesObject.rate = std::stof(allSubResultsNodeFacesFace["Rate"].asString());
if(!dataNodeElementsElementResultsResultSubResultsSubResultFacesFace["Id"].isNull())
facesObject.id = dataNodeElementsElementResultsResultSubResultsSubResultFacesFace["Id"].asString();
if(!dataNodeElementsElementResultsResultSubResultsSubResultFacesFace["Name"].isNull())
facesObject.name = dataNodeElementsElementResultsResultSubResultsSubResultFacesFace["Name"].asString();
if(!dataNodeElementsElementResultsResultSubResultsSubResultFacesFace["Rate"].isNull())
facesObject.rate = std::stof(dataNodeElementsElementResultsResultSubResultsSubResultFacesFace["Rate"].asString());
subResultsObject.faces.push_back(facesObject);
}
resultsObject.subResults.push_back(subResultsObject);

View File

@@ -44,18 +44,18 @@ void SearchFaceResult::parse(const std::string &payload)
for (auto dataNodeMatchListMatchListItem : allMatchListNode)
{
Data::MatchListItem matchListItemObject;
auto allFaceItemsNode = allMatchListNode["FaceItems"]["FaceItemsItem"];
for (auto allMatchListNodeFaceItemsFaceItemsItem : allFaceItemsNode)
auto allFaceItemsNode = dataNodeMatchListMatchListItem["FaceItems"]["FaceItemsItem"];
for (auto dataNodeMatchListMatchListItemFaceItemsFaceItemsItem : allFaceItemsNode)
{
Data::MatchListItem::FaceItemsItem faceItemsObject;
if(!allMatchListNodeFaceItemsFaceItemsItem["FaceId"].isNull())
faceItemsObject.faceId = allMatchListNodeFaceItemsFaceItemsItem["FaceId"].asString();
if(!allMatchListNodeFaceItemsFaceItemsItem["Score"].isNull())
faceItemsObject.score = std::stof(allMatchListNodeFaceItemsFaceItemsItem["Score"].asString());
if(!allMatchListNodeFaceItemsFaceItemsItem["ExtraData"].isNull())
faceItemsObject.extraData = allMatchListNodeFaceItemsFaceItemsItem["ExtraData"].asString();
if(!allMatchListNodeFaceItemsFaceItemsItem["EntityId"].isNull())
faceItemsObject.entityId = allMatchListNodeFaceItemsFaceItemsItem["EntityId"].asString();
if(!dataNodeMatchListMatchListItemFaceItemsFaceItemsItem["FaceId"].isNull())
faceItemsObject.faceId = dataNodeMatchListMatchListItemFaceItemsFaceItemsItem["FaceId"].asString();
if(!dataNodeMatchListMatchListItemFaceItemsFaceItemsItem["Score"].isNull())
faceItemsObject.score = std::stof(dataNodeMatchListMatchListItemFaceItemsFaceItemsItem["Score"].asString());
if(!dataNodeMatchListMatchListItemFaceItemsFaceItemsItem["ExtraData"].isNull())
faceItemsObject.extraData = dataNodeMatchListMatchListItemFaceItemsFaceItemsItem["ExtraData"].asString();
if(!dataNodeMatchListMatchListItemFaceItemsFaceItemsItem["EntityId"].isNull())
faceItemsObject.entityId = dataNodeMatchListMatchListItemFaceItemsFaceItemsItem["EntityId"].asString();
matchListItemObject.faceItems.push_back(faceItemsObject);
}
auto locationNode = value["Location"];

94
goodstech/CMakeLists.txt Normal file
View File

@@ -0,0 +1,94 @@
#
# 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(goodstech_public_header
include/alibabacloud/goodstech/GoodstechClient.h
include/alibabacloud/goodstech/GoodstechExport.h )
set(goodstech_public_header_model
include/alibabacloud/goodstech/model/ClassifyCommodityRequest.h
include/alibabacloud/goodstech/model/ClassifyCommodityResult.h
include/alibabacloud/goodstech/model/RecognizeFurnitureAttributeRequest.h
include/alibabacloud/goodstech/model/RecognizeFurnitureAttributeResult.h
include/alibabacloud/goodstech/model/RecognizeFurnitureSpuRequest.h
include/alibabacloud/goodstech/model/RecognizeFurnitureSpuResult.h )
set(goodstech_src
src/GoodstechClient.cc
src/model/ClassifyCommodityRequest.cc
src/model/ClassifyCommodityResult.cc
src/model/RecognizeFurnitureAttributeRequest.cc
src/model/RecognizeFurnitureAttributeResult.cc
src/model/RecognizeFurnitureSpuRequest.cc
src/model/RecognizeFurnitureSpuResult.cc )
add_library(goodstech ${LIB_TYPE}
${goodstech_public_header}
${goodstech_public_header_model}
${goodstech_src})
set_target_properties(goodstech
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}goodstech
)
if(${LIB_TYPE} STREQUAL "SHARED")
set_target_properties(goodstech
PROPERTIES
DEFINE_SYMBOL ALIBABACLOUD_GOODSTECH_LIBRARY)
endif()
target_include_directories(goodstech
PRIVATE include
${CMAKE_SOURCE_DIR}/core/include
)
target_link_libraries(goodstech
core)
if(CMAKE_HOST_WIN32)
ExternalProject_Get_Property(jsoncpp INSTALL_DIR)
set(jsoncpp_install_dir ${INSTALL_DIR})
add_dependencies(goodstech
jsoncpp)
target_include_directories(goodstech
PRIVATE ${jsoncpp_install_dir}/include)
target_link_libraries(goodstech
${jsoncpp_install_dir}/lib/jsoncpp.lib)
set_target_properties(goodstech
PROPERTIES
COMPILE_OPTIONS "/bigobj")
else()
target_include_directories(goodstech
PRIVATE /usr/include/jsoncpp)
target_link_libraries(goodstech
jsoncpp)
endif()
install(FILES ${goodstech_public_header}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/goodstech)
install(FILES ${goodstech_public_header_model}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/goodstech/model)
install(TARGETS goodstech
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)

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.
*/
#ifndef ALIBABACLOUD_GOODSTECH_GOODSTECHCLIENT_H_
#define ALIBABACLOUD_GOODSTECH_GOODSTECHCLIENT_H_
#include <future>
#include <alibabacloud/core/AsyncCallerContext.h>
#include <alibabacloud/core/EndpointProvider.h>
#include <alibabacloud/core/RpcServiceClient.h>
#include "GoodstechExport.h"
#include "model/ClassifyCommodityRequest.h"
#include "model/ClassifyCommodityResult.h"
#include "model/RecognizeFurnitureAttributeRequest.h"
#include "model/RecognizeFurnitureAttributeResult.h"
#include "model/RecognizeFurnitureSpuRequest.h"
#include "model/RecognizeFurnitureSpuResult.h"
namespace AlibabaCloud
{
namespace Goodstech
{
class ALIBABACLOUD_GOODSTECH_EXPORT GoodstechClient : public RpcServiceClient
{
public:
typedef Outcome<Error, Model::ClassifyCommodityResult> ClassifyCommodityOutcome;
typedef std::future<ClassifyCommodityOutcome> ClassifyCommodityOutcomeCallable;
typedef std::function<void(const GoodstechClient*, const Model::ClassifyCommodityRequest&, const ClassifyCommodityOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ClassifyCommodityAsyncHandler;
typedef Outcome<Error, Model::RecognizeFurnitureAttributeResult> RecognizeFurnitureAttributeOutcome;
typedef std::future<RecognizeFurnitureAttributeOutcome> RecognizeFurnitureAttributeOutcomeCallable;
typedef std::function<void(const GoodstechClient*, const Model::RecognizeFurnitureAttributeRequest&, const RecognizeFurnitureAttributeOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RecognizeFurnitureAttributeAsyncHandler;
typedef Outcome<Error, Model::RecognizeFurnitureSpuResult> RecognizeFurnitureSpuOutcome;
typedef std::future<RecognizeFurnitureSpuOutcome> RecognizeFurnitureSpuOutcomeCallable;
typedef std::function<void(const GoodstechClient*, const Model::RecognizeFurnitureSpuRequest&, const RecognizeFurnitureSpuOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RecognizeFurnitureSpuAsyncHandler;
GoodstechClient(const Credentials &credentials, const ClientConfiguration &configuration);
GoodstechClient(const std::shared_ptr<CredentialsProvider> &credentialsProvider, const ClientConfiguration &configuration);
GoodstechClient(const std::string &accessKeyId, const std::string &accessKeySecret, const ClientConfiguration &configuration);
~GoodstechClient();
ClassifyCommodityOutcome classifyCommodity(const Model::ClassifyCommodityRequest &request)const;
void classifyCommodityAsync(const Model::ClassifyCommodityRequest& request, const ClassifyCommodityAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
ClassifyCommodityOutcomeCallable classifyCommodityCallable(const Model::ClassifyCommodityRequest& request) const;
RecognizeFurnitureAttributeOutcome recognizeFurnitureAttribute(const Model::RecognizeFurnitureAttributeRequest &request)const;
void recognizeFurnitureAttributeAsync(const Model::RecognizeFurnitureAttributeRequest& request, const RecognizeFurnitureAttributeAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
RecognizeFurnitureAttributeOutcomeCallable recognizeFurnitureAttributeCallable(const Model::RecognizeFurnitureAttributeRequest& request) const;
RecognizeFurnitureSpuOutcome recognizeFurnitureSpu(const Model::RecognizeFurnitureSpuRequest &request)const;
void recognizeFurnitureSpuAsync(const Model::RecognizeFurnitureSpuRequest& request, const RecognizeFurnitureSpuAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
RecognizeFurnitureSpuOutcomeCallable recognizeFurnitureSpuCallable(const Model::RecognizeFurnitureSpuRequest& request) const;
private:
std::shared_ptr<EndpointProvider> endpointProvider_;
};
}
}
#endif // !ALIBABACLOUD_GOODSTECH_GOODSTECHCLIENT_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_GOODSTECH_GOODSTECHEXPORT_H_
#define ALIBABACLOUD_GOODSTECH_GOODSTECHEXPORT_H_
#include <alibabacloud/core/Global.h>
#if defined(ALIBABACLOUD_SHARED)
# if defined(ALIBABACLOUD_GOODSTECH_LIBRARY)
# define ALIBABACLOUD_GOODSTECH_EXPORT ALIBABACLOUD_DECL_EXPORT
# else
# define ALIBABACLOUD_GOODSTECH_EXPORT ALIBABACLOUD_DECL_IMPORT
# endif
#else
# define ALIBABACLOUD_GOODSTECH_EXPORT
#endif
#endif // !ALIBABACLOUD_GOODSTECH_GOODSTECHEXPORT_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_GOODSTECH_MODEL_CLASSIFYCOMMODITYREQUEST_H_
#define ALIBABACLOUD_GOODSTECH_MODEL_CLASSIFYCOMMODITYREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/goodstech/GoodstechExport.h>
namespace AlibabaCloud
{
namespace Goodstech
{
namespace Model
{
class ALIBABACLOUD_GOODSTECH_EXPORT ClassifyCommodityRequest : public RpcServiceRequest
{
public:
ClassifyCommodityRequest();
~ClassifyCommodityRequest();
std::string getImageURL()const;
void setImageURL(const std::string& imageURL);
private:
std::string imageURL_;
};
}
}
}
#endif // !ALIBABACLOUD_GOODSTECH_MODEL_CLASSIFYCOMMODITYREQUEST_H_

View File

@@ -0,0 +1,61 @@
/*
* 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_GOODSTECH_MODEL_CLASSIFYCOMMODITYRESULT_H_
#define ALIBABACLOUD_GOODSTECH_MODEL_CLASSIFYCOMMODITYRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/goodstech/GoodstechExport.h>
namespace AlibabaCloud
{
namespace Goodstech
{
namespace Model
{
class ALIBABACLOUD_GOODSTECH_EXPORT ClassifyCommodityResult : public ServiceResult
{
public:
struct Data
{
struct Category
{
std::string categoryId;
float score;
std::string categoryName;
};
std::vector<Category> categories;
};
ClassifyCommodityResult();
explicit ClassifyCommodityResult(const std::string &payload);
~ClassifyCommodityResult();
Data getData()const;
protected:
void parse(const std::string &payload);
private:
Data data_;
};
}
}
}
#endif // !ALIBABACLOUD_GOODSTECH_MODEL_CLASSIFYCOMMODITYRESULT_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_GOODSTECH_MODEL_RECOGNIZEFURNITUREATTRIBUTEREQUEST_H_
#define ALIBABACLOUD_GOODSTECH_MODEL_RECOGNIZEFURNITUREATTRIBUTEREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/goodstech/GoodstechExport.h>
namespace AlibabaCloud
{
namespace Goodstech
{
namespace Model
{
class ALIBABACLOUD_GOODSTECH_EXPORT RecognizeFurnitureAttributeRequest : public RpcServiceRequest
{
public:
RecognizeFurnitureAttributeRequest();
~RecognizeFurnitureAttributeRequest();
std::string getImageURL()const;
void setImageURL(const std::string& imageURL);
private:
std::string imageURL_;
};
}
}
}
#endif // !ALIBABACLOUD_GOODSTECH_MODEL_RECOGNIZEFURNITUREATTRIBUTEREQUEST_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_GOODSTECH_MODEL_RECOGNIZEFURNITUREATTRIBUTERESULT_H_
#define ALIBABACLOUD_GOODSTECH_MODEL_RECOGNIZEFURNITUREATTRIBUTERESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/goodstech/GoodstechExport.h>
namespace AlibabaCloud
{
namespace Goodstech
{
namespace Model
{
class ALIBABACLOUD_GOODSTECH_EXPORT RecognizeFurnitureAttributeResult : public ServiceResult
{
public:
struct Data
{
std::string predStyle;
float predProbability;
std::string predStyleId;
};
RecognizeFurnitureAttributeResult();
explicit RecognizeFurnitureAttributeResult(const std::string &payload);
~RecognizeFurnitureAttributeResult();
Data getData()const;
protected:
void parse(const std::string &payload);
private:
Data data_;
};
}
}
}
#endif // !ALIBABACLOUD_GOODSTECH_MODEL_RECOGNIZEFURNITUREATTRIBUTERESULT_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_GOODSTECH_MODEL_RECOGNIZEFURNITURESPUREQUEST_H_
#define ALIBABACLOUD_GOODSTECH_MODEL_RECOGNIZEFURNITURESPUREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/goodstech/GoodstechExport.h>
namespace AlibabaCloud
{
namespace Goodstech
{
namespace Model
{
class ALIBABACLOUD_GOODSTECH_EXPORT RecognizeFurnitureSpuRequest : public RpcServiceRequest
{
public:
RecognizeFurnitureSpuRequest();
~RecognizeFurnitureSpuRequest();
float getXLength()const;
void setXLength(float xLength);
float getZLength()const;
void setZLength(float zLength);
std::string getImageURL()const;
void setImageURL(const std::string& imageURL);
float getYLength()const;
void setYLength(float yLength);
private:
float xLength_;
float zLength_;
std::string imageURL_;
float yLength_;
};
}
}
}
#endif // !ALIBABACLOUD_GOODSTECH_MODEL_RECOGNIZEFURNITURESPUREQUEST_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_GOODSTECH_MODEL_RECOGNIZEFURNITURESPURESULT_H_
#define ALIBABACLOUD_GOODSTECH_MODEL_RECOGNIZEFURNITURESPURESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/goodstech/GoodstechExport.h>
namespace AlibabaCloud
{
namespace Goodstech
{
namespace Model
{
class ALIBABACLOUD_GOODSTECH_EXPORT RecognizeFurnitureSpuResult : public ServiceResult
{
public:
struct Data
{
float predProbability;
std::string predCate;
std::string predCateId;
};
RecognizeFurnitureSpuResult();
explicit RecognizeFurnitureSpuResult(const std::string &payload);
~RecognizeFurnitureSpuResult();
Data getData()const;
protected:
void parse(const std::string &payload);
private:
Data data_;
};
}
}
}
#endif // !ALIBABACLOUD_GOODSTECH_MODEL_RECOGNIZEFURNITURESPURESULT_H_

View File

@@ -0,0 +1,161 @@
/*
* 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/goodstech/GoodstechClient.h>
#include <alibabacloud/core/SimpleCredentialsProvider.h>
using namespace AlibabaCloud;
using namespace AlibabaCloud::Location;
using namespace AlibabaCloud::Goodstech;
using namespace AlibabaCloud::Goodstech::Model;
namespace
{
const std::string SERVICE_NAME = "goodstech";
}
GoodstechClient::GoodstechClient(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, "goodstech");
}
GoodstechClient::GoodstechClient(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, "goodstech");
}
GoodstechClient::GoodstechClient(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, "goodstech");
}
GoodstechClient::~GoodstechClient()
{}
GoodstechClient::ClassifyCommodityOutcome GoodstechClient::classifyCommodity(const ClassifyCommodityRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return ClassifyCommodityOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return ClassifyCommodityOutcome(ClassifyCommodityResult(outcome.result()));
else
return ClassifyCommodityOutcome(outcome.error());
}
void GoodstechClient::classifyCommodityAsync(const ClassifyCommodityRequest& request, const ClassifyCommodityAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, classifyCommodity(request), context);
};
asyncExecute(new Runnable(fn));
}
GoodstechClient::ClassifyCommodityOutcomeCallable GoodstechClient::classifyCommodityCallable(const ClassifyCommodityRequest &request) const
{
auto task = std::make_shared<std::packaged_task<ClassifyCommodityOutcome()>>(
[this, request]()
{
return this->classifyCommodity(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
GoodstechClient::RecognizeFurnitureAttributeOutcome GoodstechClient::recognizeFurnitureAttribute(const RecognizeFurnitureAttributeRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return RecognizeFurnitureAttributeOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return RecognizeFurnitureAttributeOutcome(RecognizeFurnitureAttributeResult(outcome.result()));
else
return RecognizeFurnitureAttributeOutcome(outcome.error());
}
void GoodstechClient::recognizeFurnitureAttributeAsync(const RecognizeFurnitureAttributeRequest& request, const RecognizeFurnitureAttributeAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, recognizeFurnitureAttribute(request), context);
};
asyncExecute(new Runnable(fn));
}
GoodstechClient::RecognizeFurnitureAttributeOutcomeCallable GoodstechClient::recognizeFurnitureAttributeCallable(const RecognizeFurnitureAttributeRequest &request) const
{
auto task = std::make_shared<std::packaged_task<RecognizeFurnitureAttributeOutcome()>>(
[this, request]()
{
return this->recognizeFurnitureAttribute(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
GoodstechClient::RecognizeFurnitureSpuOutcome GoodstechClient::recognizeFurnitureSpu(const RecognizeFurnitureSpuRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return RecognizeFurnitureSpuOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return RecognizeFurnitureSpuOutcome(RecognizeFurnitureSpuResult(outcome.result()));
else
return RecognizeFurnitureSpuOutcome(outcome.error());
}
void GoodstechClient::recognizeFurnitureSpuAsync(const RecognizeFurnitureSpuRequest& request, const RecognizeFurnitureSpuAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, recognizeFurnitureSpu(request), context);
};
asyncExecute(new Runnable(fn));
}
GoodstechClient::RecognizeFurnitureSpuOutcomeCallable GoodstechClient::recognizeFurnitureSpuCallable(const RecognizeFurnitureSpuRequest &request) const
{
auto task = std::make_shared<std::packaged_task<RecognizeFurnitureSpuOutcome()>>(
[this, request]()
{
return this->recognizeFurnitureSpu(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}

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/goodstech/model/ClassifyCommodityRequest.h>
using AlibabaCloud::Goodstech::Model::ClassifyCommodityRequest;
ClassifyCommodityRequest::ClassifyCommodityRequest() :
RpcServiceRequest("goodstech", "2019-12-30", "ClassifyCommodity")
{
setMethod(HttpRequest::Method::Post);
}
ClassifyCommodityRequest::~ClassifyCommodityRequest()
{}
std::string ClassifyCommodityRequest::getImageURL()const
{
return imageURL_;
}
void ClassifyCommodityRequest::setImageURL(const std::string& imageURL)
{
imageURL_ = imageURL;
setParameter("ImageURL", imageURL);
}

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/goodstech/model/ClassifyCommodityResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Goodstech;
using namespace AlibabaCloud::Goodstech::Model;
ClassifyCommodityResult::ClassifyCommodityResult() :
ServiceResult()
{}
ClassifyCommodityResult::ClassifyCommodityResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
ClassifyCommodityResult::~ClassifyCommodityResult()
{}
void ClassifyCommodityResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto dataNode = value["Data"];
auto allCategoriesNode = dataNode["Categories"]["Category"];
for (auto dataNodeCategoriesCategory : allCategoriesNode)
{
Data::Category categoryObject;
if(!dataNodeCategoriesCategory["Score"].isNull())
categoryObject.score = std::stof(dataNodeCategoriesCategory["Score"].asString());
if(!dataNodeCategoriesCategory["CategoryName"].isNull())
categoryObject.categoryName = dataNodeCategoriesCategory["CategoryName"].asString();
if(!dataNodeCategoriesCategory["CategoryId"].isNull())
categoryObject.categoryId = dataNodeCategoriesCategory["CategoryId"].asString();
data_.categories.push_back(categoryObject);
}
}
ClassifyCommodityResult::Data ClassifyCommodityResult::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/goodstech/model/RecognizeFurnitureAttributeRequest.h>
using AlibabaCloud::Goodstech::Model::RecognizeFurnitureAttributeRequest;
RecognizeFurnitureAttributeRequest::RecognizeFurnitureAttributeRequest() :
RpcServiceRequest("goodstech", "2019-12-30", "RecognizeFurnitureAttribute")
{
setMethod(HttpRequest::Method::Post);
}
RecognizeFurnitureAttributeRequest::~RecognizeFurnitureAttributeRequest()
{}
std::string RecognizeFurnitureAttributeRequest::getImageURL()const
{
return imageURL_;
}
void RecognizeFurnitureAttributeRequest::setImageURL(const std::string& imageURL)
{
imageURL_ = imageURL;
setBodyParameter("ImageURL", imageURL);
}

View File

@@ -0,0 +1,56 @@
/*
* 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/goodstech/model/RecognizeFurnitureAttributeResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Goodstech;
using namespace AlibabaCloud::Goodstech::Model;
RecognizeFurnitureAttributeResult::RecognizeFurnitureAttributeResult() :
ServiceResult()
{}
RecognizeFurnitureAttributeResult::RecognizeFurnitureAttributeResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
RecognizeFurnitureAttributeResult::~RecognizeFurnitureAttributeResult()
{}
void RecognizeFurnitureAttributeResult::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["PredStyleId"].isNull())
data_.predStyleId = dataNode["PredStyleId"].asString();
if(!dataNode["PredStyle"].isNull())
data_.predStyle = dataNode["PredStyle"].asString();
if(!dataNode["PredProbability"].isNull())
data_.predProbability = std::stof(dataNode["PredProbability"].asString());
}
RecognizeFurnitureAttributeResult::Data RecognizeFurnitureAttributeResult::getData()const
{
return data_;
}

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/goodstech/model/RecognizeFurnitureSpuRequest.h>
using AlibabaCloud::Goodstech::Model::RecognizeFurnitureSpuRequest;
RecognizeFurnitureSpuRequest::RecognizeFurnitureSpuRequest() :
RpcServiceRequest("goodstech", "2019-12-30", "RecognizeFurnitureSpu")
{
setMethod(HttpRequest::Method::Post);
}
RecognizeFurnitureSpuRequest::~RecognizeFurnitureSpuRequest()
{}
float RecognizeFurnitureSpuRequest::getXLength()const
{
return xLength_;
}
void RecognizeFurnitureSpuRequest::setXLength(float xLength)
{
xLength_ = xLength;
setBodyParameter("XLength", std::to_string(xLength));
}
float RecognizeFurnitureSpuRequest::getZLength()const
{
return zLength_;
}
void RecognizeFurnitureSpuRequest::setZLength(float zLength)
{
zLength_ = zLength;
setBodyParameter("ZLength", std::to_string(zLength));
}
std::string RecognizeFurnitureSpuRequest::getImageURL()const
{
return imageURL_;
}
void RecognizeFurnitureSpuRequest::setImageURL(const std::string& imageURL)
{
imageURL_ = imageURL;
setBodyParameter("ImageURL", imageURL);
}
float RecognizeFurnitureSpuRequest::getYLength()const
{
return yLength_;
}
void RecognizeFurnitureSpuRequest::setYLength(float yLength)
{
yLength_ = yLength;
setBodyParameter("YLength", std::to_string(yLength));
}

View File

@@ -0,0 +1,56 @@
/*
* 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/goodstech/model/RecognizeFurnitureSpuResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Goodstech;
using namespace AlibabaCloud::Goodstech::Model;
RecognizeFurnitureSpuResult::RecognizeFurnitureSpuResult() :
ServiceResult()
{}
RecognizeFurnitureSpuResult::RecognizeFurnitureSpuResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
RecognizeFurnitureSpuResult::~RecognizeFurnitureSpuResult()
{}
void RecognizeFurnitureSpuResult::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["PredCateId"].isNull())
data_.predCateId = dataNode["PredCateId"].asString();
if(!dataNode["PredCate"].isNull())
data_.predCate = dataNode["PredCate"].asString();
if(!dataNode["PredProbability"].isNull())
data_.predProbability = std::stof(dataNode["PredProbability"].asString());
}
RecognizeFurnitureSpuResult::Data RecognizeFurnitureSpuResult::getData()const
{
return data_;
}

90
imageaudit/CMakeLists.txt Normal file
View File

@@ -0,0 +1,90 @@
#
# 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(imageaudit_public_header
include/alibabacloud/imageaudit/ImageauditClient.h
include/alibabacloud/imageaudit/ImageauditExport.h )
set(imageaudit_public_header_model
include/alibabacloud/imageaudit/model/ScanImageRequest.h
include/alibabacloud/imageaudit/model/ScanImageResult.h
include/alibabacloud/imageaudit/model/ScanTextRequest.h
include/alibabacloud/imageaudit/model/ScanTextResult.h )
set(imageaudit_src
src/ImageauditClient.cc
src/model/ScanImageRequest.cc
src/model/ScanImageResult.cc
src/model/ScanTextRequest.cc
src/model/ScanTextResult.cc )
add_library(imageaudit ${LIB_TYPE}
${imageaudit_public_header}
${imageaudit_public_header_model}
${imageaudit_src})
set_target_properties(imageaudit
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}imageaudit
)
if(${LIB_TYPE} STREQUAL "SHARED")
set_target_properties(imageaudit
PROPERTIES
DEFINE_SYMBOL ALIBABACLOUD_IMAGEAUDIT_LIBRARY)
endif()
target_include_directories(imageaudit
PRIVATE include
${CMAKE_SOURCE_DIR}/core/include
)
target_link_libraries(imageaudit
core)
if(CMAKE_HOST_WIN32)
ExternalProject_Get_Property(jsoncpp INSTALL_DIR)
set(jsoncpp_install_dir ${INSTALL_DIR})
add_dependencies(imageaudit
jsoncpp)
target_include_directories(imageaudit
PRIVATE ${jsoncpp_install_dir}/include)
target_link_libraries(imageaudit
${jsoncpp_install_dir}/lib/jsoncpp.lib)
set_target_properties(imageaudit
PROPERTIES
COMPILE_OPTIONS "/bigobj")
else()
target_include_directories(imageaudit
PRIVATE /usr/include/jsoncpp)
target_link_libraries(imageaudit
jsoncpp)
endif()
install(FILES ${imageaudit_public_header}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/imageaudit)
install(FILES ${imageaudit_public_header_model}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/imageaudit/model)
install(TARGETS imageaudit
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)

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.
*/
#ifndef ALIBABACLOUD_IMAGEAUDIT_IMAGEAUDITCLIENT_H_
#define ALIBABACLOUD_IMAGEAUDIT_IMAGEAUDITCLIENT_H_
#include <future>
#include <alibabacloud/core/AsyncCallerContext.h>
#include <alibabacloud/core/EndpointProvider.h>
#include <alibabacloud/core/RpcServiceClient.h>
#include "ImageauditExport.h"
#include "model/ScanImageRequest.h"
#include "model/ScanImageResult.h"
#include "model/ScanTextRequest.h"
#include "model/ScanTextResult.h"
namespace AlibabaCloud
{
namespace Imageaudit
{
class ALIBABACLOUD_IMAGEAUDIT_EXPORT ImageauditClient : public RpcServiceClient
{
public:
typedef Outcome<Error, Model::ScanImageResult> ScanImageOutcome;
typedef std::future<ScanImageOutcome> ScanImageOutcomeCallable;
typedef std::function<void(const ImageauditClient*, const Model::ScanImageRequest&, const ScanImageOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ScanImageAsyncHandler;
typedef Outcome<Error, Model::ScanTextResult> ScanTextOutcome;
typedef std::future<ScanTextOutcome> ScanTextOutcomeCallable;
typedef std::function<void(const ImageauditClient*, const Model::ScanTextRequest&, const ScanTextOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ScanTextAsyncHandler;
ImageauditClient(const Credentials &credentials, const ClientConfiguration &configuration);
ImageauditClient(const std::shared_ptr<CredentialsProvider> &credentialsProvider, const ClientConfiguration &configuration);
ImageauditClient(const std::string &accessKeyId, const std::string &accessKeySecret, const ClientConfiguration &configuration);
~ImageauditClient();
ScanImageOutcome scanImage(const Model::ScanImageRequest &request)const;
void scanImageAsync(const Model::ScanImageRequest& request, const ScanImageAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
ScanImageOutcomeCallable scanImageCallable(const Model::ScanImageRequest& request) const;
ScanTextOutcome scanText(const Model::ScanTextRequest &request)const;
void scanTextAsync(const Model::ScanTextRequest& request, const ScanTextAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
ScanTextOutcomeCallable scanTextCallable(const Model::ScanTextRequest& request) const;
private:
std::shared_ptr<EndpointProvider> endpointProvider_;
};
}
}
#endif // !ALIBABACLOUD_IMAGEAUDIT_IMAGEAUDITCLIENT_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_IMAGEAUDIT_IMAGEAUDITEXPORT_H_
#define ALIBABACLOUD_IMAGEAUDIT_IMAGEAUDITEXPORT_H_
#include <alibabacloud/core/Global.h>
#if defined(ALIBABACLOUD_SHARED)
# if defined(ALIBABACLOUD_IMAGEAUDIT_LIBRARY)
# define ALIBABACLOUD_IMAGEAUDIT_EXPORT ALIBABACLOUD_DECL_EXPORT
# else
# define ALIBABACLOUD_IMAGEAUDIT_EXPORT ALIBABACLOUD_DECL_IMPORT
# endif
#else
# define ALIBABACLOUD_IMAGEAUDIT_EXPORT
#endif
#endif // !ALIBABACLOUD_IMAGEAUDIT_IMAGEAUDITEXPORT_H_

View File

@@ -0,0 +1,60 @@
/*
* 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_IMAGEAUDIT_MODEL_SCANIMAGEREQUEST_H_
#define ALIBABACLOUD_IMAGEAUDIT_MODEL_SCANIMAGEREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/imageaudit/ImageauditExport.h>
namespace AlibabaCloud
{
namespace Imageaudit
{
namespace Model
{
class ALIBABACLOUD_IMAGEAUDIT_EXPORT ScanImageRequest : public RpcServiceRequest
{
public:
struct Task
{
std::string dataId;
std::string imageURL;
int maxFrames;
int interval;
long imageTimeMillisecond;
};
public:
ScanImageRequest();
~ScanImageRequest();
std::vector<std::string> getScene()const;
void setScene(const std::vector<std::string>& scene);
std::vector<Task> getTask()const;
void setTask(const std::vector<Task>& task);
private:
std::vector<std::string> scene_;
std::vector<Task> task_;
};
}
}
}
#endif // !ALIBABACLOUD_IMAGEAUDIT_MODEL_SCANIMAGEREQUEST_H_

View File

@@ -0,0 +1,114 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ALIBABACLOUD_IMAGEAUDIT_MODEL_SCANIMAGERESULT_H_
#define ALIBABACLOUD_IMAGEAUDIT_MODEL_SCANIMAGERESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/imageaudit/ImageauditExport.h>
namespace AlibabaCloud
{
namespace Imageaudit
{
namespace Model
{
class ALIBABACLOUD_IMAGEAUDIT_EXPORT ScanImageResult : public ServiceResult
{
public:
struct Data
{
struct Result
{
struct SubResult
{
struct Frame
{
float rate;
std::string uRL;
};
struct HintWordsInfo
{
std::string context;
};
struct ProgramCodeData
{
float x;
float y;
float height;
float width;
};
struct LogoData
{
std::string type;
float x;
float y;
float height;
float width;
std::string name;
};
struct SfaceData
{
struct Face
{
float rate;
std::string id;
std::string name;
};
float x;
float y;
float height;
float width;
std::vector<SfaceData::Face> faces;
};
std::vector<SubResult::Frame> frames;
std::string suggestion;
std::vector<SubResult::SfaceData> sfaceDataList;
float rate;
std::vector<std::string> oCRDataList;
std::vector<SubResult::HintWordsInfo> hintWordsInfoList;
std::string label;
std::vector<SubResult::LogoData> logoDataList;
std::string scene;
std::vector<SubResult::ProgramCodeData> programCodeDataList;
};
std::string dataId;
std::string taskId;
std::string imageURL;
std::vector<Result::SubResult> subResults;
};
std::vector<Result> results;
};
ScanImageResult();
explicit ScanImageResult(const std::string &payload);
~ScanImageResult();
Data getData()const;
protected:
void parse(const std::string &payload);
private:
Data data_;
};
}
}
}
#endif // !ALIBABACLOUD_IMAGEAUDIT_MODEL_SCANIMAGERESULT_H_

View File

@@ -0,0 +1,60 @@
/*
* 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_IMAGEAUDIT_MODEL_SCANTEXTREQUEST_H_
#define ALIBABACLOUD_IMAGEAUDIT_MODEL_SCANTEXTREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/imageaudit/ImageauditExport.h>
namespace AlibabaCloud
{
namespace Imageaudit
{
namespace Model
{
class ALIBABACLOUD_IMAGEAUDIT_EXPORT ScanTextRequest : public RpcServiceRequest
{
public:
struct Labels
{
std::string label;
};
struct Tasks
{
std::string content;
};
public:
ScanTextRequest();
~ScanTextRequest();
std::vector<Labels> getLabels()const;
void setLabels(const std::vector<Labels>& labels);
std::vector<Tasks> getTasks()const;
void setTasks(const std::vector<Tasks>& tasks);
private:
std::vector<Labels> labels_;
std::vector<Tasks> tasks_;
};
}
}
}
#endif // !ALIBABACLOUD_IMAGEAUDIT_MODEL_SCANTEXTREQUEST_H_

View File

@@ -0,0 +1,76 @@
/*
* 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_IMAGEAUDIT_MODEL_SCANTEXTRESULT_H_
#define ALIBABACLOUD_IMAGEAUDIT_MODEL_SCANTEXTRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/imageaudit/ImageauditExport.h>
namespace AlibabaCloud
{
namespace Imageaudit
{
namespace Model
{
class ALIBABACLOUD_IMAGEAUDIT_EXPORT ScanTextResult : public ServiceResult
{
public:
struct Data
{
struct Element
{
struct Result
{
struct Detail
{
struct Context
{
std::string context;
};
std::string label;
std::vector<Detail::Context> contexts;
};
std::string suggestion;
std::vector<Result::Detail> details;
float rate;
std::string label;
};
std::string taskId;
std::vector<Element::Result> results;
};
std::vector<Element> elements;
};
ScanTextResult();
explicit ScanTextResult(const std::string &payload);
~ScanTextResult();
Data getData()const;
protected:
void parse(const std::string &payload);
private:
Data data_;
};
}
}
}
#endif // !ALIBABACLOUD_IMAGEAUDIT_MODEL_SCANTEXTRESULT_H_

View File

@@ -0,0 +1,125 @@
/*
* 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/imageaudit/ImageauditClient.h>
#include <alibabacloud/core/SimpleCredentialsProvider.h>
using namespace AlibabaCloud;
using namespace AlibabaCloud::Location;
using namespace AlibabaCloud::Imageaudit;
using namespace AlibabaCloud::Imageaudit::Model;
namespace
{
const std::string SERVICE_NAME = "imageaudit";
}
ImageauditClient::ImageauditClient(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, "imageaudit");
}
ImageauditClient::ImageauditClient(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, "imageaudit");
}
ImageauditClient::ImageauditClient(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, "imageaudit");
}
ImageauditClient::~ImageauditClient()
{}
ImageauditClient::ScanImageOutcome ImageauditClient::scanImage(const ScanImageRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return ScanImageOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return ScanImageOutcome(ScanImageResult(outcome.result()));
else
return ScanImageOutcome(outcome.error());
}
void ImageauditClient::scanImageAsync(const ScanImageRequest& request, const ScanImageAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, scanImage(request), context);
};
asyncExecute(new Runnable(fn));
}
ImageauditClient::ScanImageOutcomeCallable ImageauditClient::scanImageCallable(const ScanImageRequest &request) const
{
auto task = std::make_shared<std::packaged_task<ScanImageOutcome()>>(
[this, request]()
{
return this->scanImage(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
ImageauditClient::ScanTextOutcome ImageauditClient::scanText(const ScanTextRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return ScanTextOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return ScanTextOutcome(ScanTextResult(outcome.result()));
else
return ScanTextOutcome(outcome.error());
}
void ImageauditClient::scanTextAsync(const ScanTextRequest& request, const ScanTextAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, scanText(request), context);
};
asyncExecute(new Runnable(fn));
}
ImageauditClient::ScanTextOutcomeCallable ImageauditClient::scanTextCallable(const ScanTextRequest &request) const
{
auto task = std::make_shared<std::packaged_task<ScanTextOutcome()>>(
[this, request]()
{
return this->scanText(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}

View File

@@ -0,0 +1,61 @@
/*
* 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/imageaudit/model/ScanImageRequest.h>
using AlibabaCloud::Imageaudit::Model::ScanImageRequest;
ScanImageRequest::ScanImageRequest() :
RpcServiceRequest("imageaudit", "2019-12-30", "ScanImage")
{
setMethod(HttpRequest::Method::Post);
}
ScanImageRequest::~ScanImageRequest()
{}
std::vector<std::string> ScanImageRequest::getScene()const
{
return scene_;
}
void ScanImageRequest::setScene(const std::vector<std::string>& scene)
{
scene_ = scene;
for(int dep1 = 0; dep1!= scene.size(); dep1++) {
setBodyParameter("Scene."+ std::to_string(dep1), scene.at(dep1));
}
}
std::vector<ScanImageRequest::Task> ScanImageRequest::getTask()const
{
return task_;
}
void ScanImageRequest::setTask(const std::vector<Task>& task)
{
task_ = task;
for(int dep1 = 0; dep1!= task.size(); dep1++) {
auto taskObj = task.at(dep1);
std::string taskObjStr = "Task." + std::to_string(dep1 + 1);
setParameter(taskObjStr + ".DataId", taskObj.dataId);
setParameter(taskObjStr + ".ImageURL", taskObj.imageURL);
setParameter(taskObjStr + ".MaxFrames", std::to_string(taskObj.maxFrames));
setParameter(taskObjStr + ".Interval", std::to_string(taskObj.interval));
setParameter(taskObjStr + ".ImageTimeMillisecond", std::to_string(taskObj.imageTimeMillisecond));
}
}

View File

@@ -0,0 +1,155 @@
/*
* 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/imageaudit/model/ScanImageResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Imageaudit;
using namespace AlibabaCloud::Imageaudit::Model;
ScanImageResult::ScanImageResult() :
ServiceResult()
{}
ScanImageResult::ScanImageResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
ScanImageResult::~ScanImageResult()
{}
void ScanImageResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto dataNode = value["Data"];
auto allResultsNode = dataNode["Results"]["Result"];
for (auto dataNodeResultsResult : allResultsNode)
{
Data::Result resultObject;
if(!dataNodeResultsResult["DataId"].isNull())
resultObject.dataId = dataNodeResultsResult["DataId"].asString();
if(!dataNodeResultsResult["TaskId"].isNull())
resultObject.taskId = dataNodeResultsResult["TaskId"].asString();
if(!dataNodeResultsResult["ImageURL"].isNull())
resultObject.imageURL = dataNodeResultsResult["ImageURL"].asString();
auto allSubResultsNode = dataNodeResultsResult["SubResults"]["SubResult"];
for (auto dataNodeResultsResultSubResultsSubResult : allSubResultsNode)
{
Data::Result::SubResult subResultsObject;
if(!dataNodeResultsResultSubResultsSubResult["Label"].isNull())
subResultsObject.label = dataNodeResultsResultSubResultsSubResult["Label"].asString();
if(!dataNodeResultsResultSubResultsSubResult["Suggestion"].isNull())
subResultsObject.suggestion = dataNodeResultsResultSubResultsSubResult["Suggestion"].asString();
if(!dataNodeResultsResultSubResultsSubResult["Rate"].isNull())
subResultsObject.rate = std::stof(dataNodeResultsResultSubResultsSubResult["Rate"].asString());
if(!dataNodeResultsResultSubResultsSubResult["Scene"].isNull())
subResultsObject.scene = dataNodeResultsResultSubResultsSubResult["Scene"].asString();
auto allFramesNode = dataNodeResultsResultSubResultsSubResult["Frames"]["Frame"];
for (auto dataNodeResultsResultSubResultsSubResultFramesFrame : allFramesNode)
{
Data::Result::SubResult::Frame framesObject;
if(!dataNodeResultsResultSubResultsSubResultFramesFrame["Rate"].isNull())
framesObject.rate = std::stof(dataNodeResultsResultSubResultsSubResultFramesFrame["Rate"].asString());
if(!dataNodeResultsResultSubResultsSubResultFramesFrame["URL"].isNull())
framesObject.uRL = dataNodeResultsResultSubResultsSubResultFramesFrame["URL"].asString();
subResultsObject.frames.push_back(framesObject);
}
auto allHintWordsInfoListNode = dataNodeResultsResultSubResultsSubResult["HintWordsInfoList"]["HintWordsInfo"];
for (auto dataNodeResultsResultSubResultsSubResultHintWordsInfoListHintWordsInfo : allHintWordsInfoListNode)
{
Data::Result::SubResult::HintWordsInfo hintWordsInfoListObject;
if(!dataNodeResultsResultSubResultsSubResultHintWordsInfoListHintWordsInfo["Context"].isNull())
hintWordsInfoListObject.context = dataNodeResultsResultSubResultsSubResultHintWordsInfoListHintWordsInfo["Context"].asString();
subResultsObject.hintWordsInfoList.push_back(hintWordsInfoListObject);
}
auto allProgramCodeDataListNode = dataNodeResultsResultSubResultsSubResult["ProgramCodeDataList"]["ProgramCodeData"];
for (auto dataNodeResultsResultSubResultsSubResultProgramCodeDataListProgramCodeData : allProgramCodeDataListNode)
{
Data::Result::SubResult::ProgramCodeData programCodeDataListObject;
if(!dataNodeResultsResultSubResultsSubResultProgramCodeDataListProgramCodeData["X"].isNull())
programCodeDataListObject.x = std::stof(dataNodeResultsResultSubResultsSubResultProgramCodeDataListProgramCodeData["X"].asString());
if(!dataNodeResultsResultSubResultsSubResultProgramCodeDataListProgramCodeData["Y"].isNull())
programCodeDataListObject.y = std::stof(dataNodeResultsResultSubResultsSubResultProgramCodeDataListProgramCodeData["Y"].asString());
if(!dataNodeResultsResultSubResultsSubResultProgramCodeDataListProgramCodeData["Width"].isNull())
programCodeDataListObject.width = std::stof(dataNodeResultsResultSubResultsSubResultProgramCodeDataListProgramCodeData["Width"].asString());
if(!dataNodeResultsResultSubResultsSubResultProgramCodeDataListProgramCodeData["Height"].isNull())
programCodeDataListObject.height = std::stof(dataNodeResultsResultSubResultsSubResultProgramCodeDataListProgramCodeData["Height"].asString());
subResultsObject.programCodeDataList.push_back(programCodeDataListObject);
}
auto allLogoDataListNode = dataNodeResultsResultSubResultsSubResult["LogoDataList"]["LogoData"];
for (auto dataNodeResultsResultSubResultsSubResultLogoDataListLogoData : allLogoDataListNode)
{
Data::Result::SubResult::LogoData logoDataListObject;
if(!dataNodeResultsResultSubResultsSubResultLogoDataListLogoData["Type"].isNull())
logoDataListObject.type = dataNodeResultsResultSubResultsSubResultLogoDataListLogoData["Type"].asString();
if(!dataNodeResultsResultSubResultsSubResultLogoDataListLogoData["Name"].isNull())
logoDataListObject.name = dataNodeResultsResultSubResultsSubResultLogoDataListLogoData["Name"].asString();
if(!dataNodeResultsResultSubResultsSubResultLogoDataListLogoData["X"].isNull())
logoDataListObject.x = std::stof(dataNodeResultsResultSubResultsSubResultLogoDataListLogoData["X"].asString());
if(!dataNodeResultsResultSubResultsSubResultLogoDataListLogoData["Y"].isNull())
logoDataListObject.y = std::stof(dataNodeResultsResultSubResultsSubResultLogoDataListLogoData["Y"].asString());
if(!dataNodeResultsResultSubResultsSubResultLogoDataListLogoData["Width"].isNull())
logoDataListObject.width = std::stof(dataNodeResultsResultSubResultsSubResultLogoDataListLogoData["Width"].asString());
if(!dataNodeResultsResultSubResultsSubResultLogoDataListLogoData["Height"].isNull())
logoDataListObject.height = std::stof(dataNodeResultsResultSubResultsSubResultLogoDataListLogoData["Height"].asString());
subResultsObject.logoDataList.push_back(logoDataListObject);
}
auto allSfaceDataListNode = dataNodeResultsResultSubResultsSubResult["SfaceDataList"]["SfaceData"];
for (auto dataNodeResultsResultSubResultsSubResultSfaceDataListSfaceData : allSfaceDataListNode)
{
Data::Result::SubResult::SfaceData sfaceDataListObject;
if(!dataNodeResultsResultSubResultsSubResultSfaceDataListSfaceData["X"].isNull())
sfaceDataListObject.x = std::stof(dataNodeResultsResultSubResultsSubResultSfaceDataListSfaceData["X"].asString());
if(!dataNodeResultsResultSubResultsSubResultSfaceDataListSfaceData["Y"].isNull())
sfaceDataListObject.y = std::stof(dataNodeResultsResultSubResultsSubResultSfaceDataListSfaceData["Y"].asString());
if(!dataNodeResultsResultSubResultsSubResultSfaceDataListSfaceData["Width"].isNull())
sfaceDataListObject.width = std::stof(dataNodeResultsResultSubResultsSubResultSfaceDataListSfaceData["Width"].asString());
if(!dataNodeResultsResultSubResultsSubResultSfaceDataListSfaceData["Height"].isNull())
sfaceDataListObject.height = std::stof(dataNodeResultsResultSubResultsSubResultSfaceDataListSfaceData["Height"].asString());
auto allFacesNode = dataNodeResultsResultSubResultsSubResultSfaceDataListSfaceData["Faces"]["Face"];
for (auto dataNodeResultsResultSubResultsSubResultSfaceDataListSfaceDataFacesFace : allFacesNode)
{
Data::Result::SubResult::SfaceData::Face facesObject;
if(!dataNodeResultsResultSubResultsSubResultSfaceDataListSfaceDataFacesFace["Name"].isNull())
facesObject.name = dataNodeResultsResultSubResultsSubResultSfaceDataListSfaceDataFacesFace["Name"].asString();
if(!dataNodeResultsResultSubResultsSubResultSfaceDataListSfaceDataFacesFace["Rate"].isNull())
facesObject.rate = std::stof(dataNodeResultsResultSubResultsSubResultSfaceDataListSfaceDataFacesFace["Rate"].asString());
if(!dataNodeResultsResultSubResultsSubResultSfaceDataListSfaceDataFacesFace["Id"].isNull())
facesObject.id = dataNodeResultsResultSubResultsSubResultSfaceDataListSfaceDataFacesFace["Id"].asString();
sfaceDataListObject.faces.push_back(facesObject);
}
subResultsObject.sfaceDataList.push_back(sfaceDataListObject);
}
auto allOCRDataList = value["OCRDataList"]["OCRData"];
for (auto value : allOCRDataList)
subResultsObject.oCRDataList.push_back(value.asString());
resultObject.subResults.push_back(subResultsObject);
}
data_.results.push_back(resultObject);
}
}
ScanImageResult::Data ScanImageResult::getData()const
{
return data_;
}

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.
*/
#include <alibabacloud/imageaudit/model/ScanTextRequest.h>
using AlibabaCloud::Imageaudit::Model::ScanTextRequest;
ScanTextRequest::ScanTextRequest() :
RpcServiceRequest("imageaudit", "2019-12-30", "ScanText")
{
setMethod(HttpRequest::Method::Post);
}
ScanTextRequest::~ScanTextRequest()
{}
std::vector<ScanTextRequest::Labels> ScanTextRequest::getLabels()const
{
return labels_;
}
void ScanTextRequest::setLabels(const std::vector<Labels>& labels)
{
labels_ = labels;
for(int dep1 = 0; dep1!= labels.size(); dep1++) {
auto labelsObj = labels.at(dep1);
std::string labelsObjStr = "Labels." + std::to_string(dep1 + 1);
setParameter(labelsObjStr + ".Label", labelsObj.label);
}
}
std::vector<ScanTextRequest::Tasks> ScanTextRequest::getTasks()const
{
return tasks_;
}
void ScanTextRequest::setTasks(const std::vector<Tasks>& tasks)
{
tasks_ = tasks;
for(int dep1 = 0; dep1!= tasks.size(); dep1++) {
auto tasksObj = tasks.at(dep1);
std::string tasksObjStr = "Tasks." + std::to_string(dep1 + 1);
setParameter(tasksObjStr + ".Content", tasksObj.content);
}
}

View File

@@ -0,0 +1,86 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <alibabacloud/imageaudit/model/ScanTextResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Imageaudit;
using namespace AlibabaCloud::Imageaudit::Model;
ScanTextResult::ScanTextResult() :
ServiceResult()
{}
ScanTextResult::ScanTextResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
ScanTextResult::~ScanTextResult()
{}
void ScanTextResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto dataNode = value["Data"];
auto allElementsNode = dataNode["Elements"]["Element"];
for (auto dataNodeElementsElement : allElementsNode)
{
Data::Element elementObject;
if(!dataNodeElementsElement["TaskId"].isNull())
elementObject.taskId = dataNodeElementsElement["TaskId"].asString();
auto allResultsNode = dataNodeElementsElement["Results"]["Result"];
for (auto dataNodeElementsElementResultsResult : allResultsNode)
{
Data::Element::Result resultsObject;
if(!dataNodeElementsElementResultsResult["Label"].isNull())
resultsObject.label = dataNodeElementsElementResultsResult["Label"].asString();
if(!dataNodeElementsElementResultsResult["Suggestion"].isNull())
resultsObject.suggestion = dataNodeElementsElementResultsResult["Suggestion"].asString();
if(!dataNodeElementsElementResultsResult["Rate"].isNull())
resultsObject.rate = std::stof(dataNodeElementsElementResultsResult["Rate"].asString());
auto allDetailsNode = dataNodeElementsElementResultsResult["Details"]["Detail"];
for (auto dataNodeElementsElementResultsResultDetailsDetail : allDetailsNode)
{
Data::Element::Result::Detail detailsObject;
if(!dataNodeElementsElementResultsResultDetailsDetail["Label"].isNull())
detailsObject.label = dataNodeElementsElementResultsResultDetailsDetail["Label"].asString();
auto allContextsNode = dataNodeElementsElementResultsResultDetailsDetail["Contexts"]["Context"];
for (auto dataNodeElementsElementResultsResultDetailsDetailContextsContext : allContextsNode)
{
Data::Element::Result::Detail::Context contextsObject;
if(!dataNodeElementsElementResultsResultDetailsDetailContextsContext["Context"].isNull())
contextsObject.context = dataNodeElementsElementResultsResultDetailsDetailContextsContext["Context"].asString();
detailsObject.contexts.push_back(contextsObject);
}
resultsObject.details.push_back(detailsObject);
}
elementObject.results.push_back(resultsObject);
}
data_.elements.push_back(elementObject);
}
}
ScanTextResult::Data ScanTextResult::getData()const
{
return data_;
}

View File

@@ -31,6 +31,8 @@ set(imageenhan_public_header_model
include/alibabacloud/imageenhan/model/ChangeImageSizeResult.h
include/alibabacloud/imageenhan/model/EnhanceImageColorRequest.h
include/alibabacloud/imageenhan/model/EnhanceImageColorResult.h
include/alibabacloud/imageenhan/model/ErasePersonRequest.h
include/alibabacloud/imageenhan/model/ErasePersonResult.h
include/alibabacloud/imageenhan/model/ExtendImageStyleRequest.h
include/alibabacloud/imageenhan/model/ExtendImageStyleResult.h
include/alibabacloud/imageenhan/model/GenerateDynamicImageRequest.h
@@ -68,6 +70,8 @@ set(imageenhan_src
src/model/ChangeImageSizeResult.cc
src/model/EnhanceImageColorRequest.cc
src/model/EnhanceImageColorResult.cc
src/model/ErasePersonRequest.cc
src/model/ErasePersonResult.cc
src/model/ExtendImageStyleRequest.cc
src/model/ExtendImageStyleResult.cc
src/model/GenerateDynamicImageRequest.cc

View File

@@ -32,6 +32,8 @@
#include "model/ChangeImageSizeResult.h"
#include "model/EnhanceImageColorRequest.h"
#include "model/EnhanceImageColorResult.h"
#include "model/ErasePersonRequest.h"
#include "model/ErasePersonResult.h"
#include "model/ExtendImageStyleRequest.h"
#include "model/ExtendImageStyleResult.h"
#include "model/GenerateDynamicImageRequest.h"
@@ -80,6 +82,9 @@ namespace AlibabaCloud
typedef Outcome<Error, Model::EnhanceImageColorResult> EnhanceImageColorOutcome;
typedef std::future<EnhanceImageColorOutcome> EnhanceImageColorOutcomeCallable;
typedef std::function<void(const ImageenhanClient*, const Model::EnhanceImageColorRequest&, const EnhanceImageColorOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> EnhanceImageColorAsyncHandler;
typedef Outcome<Error, Model::ErasePersonResult> ErasePersonOutcome;
typedef std::future<ErasePersonOutcome> ErasePersonOutcomeCallable;
typedef std::function<void(const ImageenhanClient*, const Model::ErasePersonRequest&, const ErasePersonOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ErasePersonAsyncHandler;
typedef Outcome<Error, Model::ExtendImageStyleResult> ExtendImageStyleOutcome;
typedef std::future<ExtendImageStyleOutcome> ExtendImageStyleOutcomeCallable;
typedef std::function<void(const ImageenhanClient*, const Model::ExtendImageStyleRequest&, const ExtendImageStyleOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ExtendImageStyleAsyncHandler;
@@ -136,6 +141,9 @@ namespace AlibabaCloud
EnhanceImageColorOutcome enhanceImageColor(const Model::EnhanceImageColorRequest &request)const;
void enhanceImageColorAsync(const Model::EnhanceImageColorRequest& request, const EnhanceImageColorAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
EnhanceImageColorOutcomeCallable enhanceImageColorCallable(const Model::EnhanceImageColorRequest& request) const;
ErasePersonOutcome erasePerson(const Model::ErasePersonRequest &request)const;
void erasePersonAsync(const Model::ErasePersonRequest& request, const ErasePersonAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
ErasePersonOutcomeCallable erasePersonCallable(const Model::ErasePersonRequest& request) const;
ExtendImageStyleOutcome extendImageStyle(const Model::ExtendImageStyleRequest &request)const;
void extendImageStyleAsync(const Model::ExtendImageStyleRequest& request, const ExtendImageStyleAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
ExtendImageStyleOutcomeCallable extendImageStyleCallable(const Model::ExtendImageStyleRequest& request) const;

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_IMAGEENHAN_MODEL_ERASEPERSONREQUEST_H_
#define ALIBABACLOUD_IMAGEENHAN_MODEL_ERASEPERSONREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/imageenhan/ImageenhanExport.h>
namespace AlibabaCloud
{
namespace Imageenhan
{
namespace Model
{
class ALIBABACLOUD_IMAGEENHAN_EXPORT ErasePersonRequest : public RpcServiceRequest
{
public:
ErasePersonRequest();
~ErasePersonRequest();
std::string getImageURL()const;
void setImageURL(const std::string& imageURL);
std::string getUserMask()const;
void setUserMask(const std::string& userMask);
private:
std::string imageURL_;
std::string userMask_;
};
}
}
}
#endif // !ALIBABACLOUD_IMAGEENHAN_MODEL_ERASEPERSONREQUEST_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_IMAGEENHAN_MODEL_ERASEPERSONRESULT_H_
#define ALIBABACLOUD_IMAGEENHAN_MODEL_ERASEPERSONRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/imageenhan/ImageenhanExport.h>
namespace AlibabaCloud
{
namespace Imageenhan
{
namespace Model
{
class ALIBABACLOUD_IMAGEENHAN_EXPORT ErasePersonResult : public ServiceResult
{
public:
struct Data
{
std::string imageUrl;
};
ErasePersonResult();
explicit ErasePersonResult(const std::string &payload);
~ErasePersonResult();
Data getData()const;
protected:
void parse(const std::string &payload);
private:
Data data_;
};
}
}
}
#endif // !ALIBABACLOUD_IMAGEENHAN_MODEL_ERASEPERSONRESULT_H_

View File

@@ -231,6 +231,42 @@ ImageenhanClient::EnhanceImageColorOutcomeCallable ImageenhanClient::enhanceImag
return task->get_future();
}
ImageenhanClient::ErasePersonOutcome ImageenhanClient::erasePerson(const ErasePersonRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return ErasePersonOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return ErasePersonOutcome(ErasePersonResult(outcome.result()));
else
return ErasePersonOutcome(outcome.error());
}
void ImageenhanClient::erasePersonAsync(const ErasePersonRequest& request, const ErasePersonAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, erasePerson(request), context);
};
asyncExecute(new Runnable(fn));
}
ImageenhanClient::ErasePersonOutcomeCallable ImageenhanClient::erasePersonCallable(const ErasePersonRequest &request) const
{
auto task = std::make_shared<std::packaged_task<ErasePersonOutcome()>>(
[this, request]()
{
return this->erasePerson(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
ImageenhanClient::ExtendImageStyleOutcome ImageenhanClient::extendImageStyle(const ExtendImageStyleRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();

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/imageenhan/model/ErasePersonRequest.h>
using AlibabaCloud::Imageenhan::Model::ErasePersonRequest;
ErasePersonRequest::ErasePersonRequest() :
RpcServiceRequest("imageenhan", "2019-09-30", "ErasePerson")
{
setMethod(HttpRequest::Method::Post);
}
ErasePersonRequest::~ErasePersonRequest()
{}
std::string ErasePersonRequest::getImageURL()const
{
return imageURL_;
}
void ErasePersonRequest::setImageURL(const std::string& imageURL)
{
imageURL_ = imageURL;
setBodyParameter("ImageURL", imageURL);
}
std::string ErasePersonRequest::getUserMask()const
{
return userMask_;
}
void ErasePersonRequest::setUserMask(const std::string& userMask)
{
userMask_ = userMask;
setBodyParameter("UserMask", userMask);
}

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/imageenhan/model/ErasePersonResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Imageenhan;
using namespace AlibabaCloud::Imageenhan::Model;
ErasePersonResult::ErasePersonResult() :
ServiceResult()
{}
ErasePersonResult::ErasePersonResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
ErasePersonResult::~ErasePersonResult()
{}
void ErasePersonResult::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["ImageUrl"].isNull())
data_.imageUrl = dataNode["ImageUrl"].asString();
}
ErasePersonResult::Data ErasePersonResult::getData()const
{
return data_;
}

118
imagerecog/CMakeLists.txt Normal file
View File

@@ -0,0 +1,118 @@
#
# Copyright 2009-2017 Alibaba Cloud All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
set(public_header_dir ${CMAKE_CURRENT_SOURCE_DIR}/../include)
set(imagerecog_public_header
include/alibabacloud/imagerecog/ImagerecogClient.h
include/alibabacloud/imagerecog/ImagerecogExport.h )
set(imagerecog_public_header_model
include/alibabacloud/imagerecog/model/ClassifyingRubbishRequest.h
include/alibabacloud/imagerecog/model/ClassifyingRubbishResult.h
include/alibabacloud/imagerecog/model/DetectFruitsRequest.h
include/alibabacloud/imagerecog/model/DetectFruitsResult.h
include/alibabacloud/imagerecog/model/DetectImageElementsRequest.h
include/alibabacloud/imagerecog/model/DetectImageElementsResult.h
include/alibabacloud/imagerecog/model/RecognizeImageColorRequest.h
include/alibabacloud/imagerecog/model/RecognizeImageColorResult.h
include/alibabacloud/imagerecog/model/RecognizeImageStyleRequest.h
include/alibabacloud/imagerecog/model/RecognizeImageStyleResult.h
include/alibabacloud/imagerecog/model/RecognizeLogoRequest.h
include/alibabacloud/imagerecog/model/RecognizeLogoResult.h
include/alibabacloud/imagerecog/model/RecognizeSceneRequest.h
include/alibabacloud/imagerecog/model/RecognizeSceneResult.h
include/alibabacloud/imagerecog/model/RecognizeVehicleTypeRequest.h
include/alibabacloud/imagerecog/model/RecognizeVehicleTypeResult.h
include/alibabacloud/imagerecog/model/TaggingImageRequest.h
include/alibabacloud/imagerecog/model/TaggingImageResult.h )
set(imagerecog_src
src/ImagerecogClient.cc
src/model/ClassifyingRubbishRequest.cc
src/model/ClassifyingRubbishResult.cc
src/model/DetectFruitsRequest.cc
src/model/DetectFruitsResult.cc
src/model/DetectImageElementsRequest.cc
src/model/DetectImageElementsResult.cc
src/model/RecognizeImageColorRequest.cc
src/model/RecognizeImageColorResult.cc
src/model/RecognizeImageStyleRequest.cc
src/model/RecognizeImageStyleResult.cc
src/model/RecognizeLogoRequest.cc
src/model/RecognizeLogoResult.cc
src/model/RecognizeSceneRequest.cc
src/model/RecognizeSceneResult.cc
src/model/RecognizeVehicleTypeRequest.cc
src/model/RecognizeVehicleTypeResult.cc
src/model/TaggingImageRequest.cc
src/model/TaggingImageResult.cc )
add_library(imagerecog ${LIB_TYPE}
${imagerecog_public_header}
${imagerecog_public_header_model}
${imagerecog_src})
set_target_properties(imagerecog
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}imagerecog
)
if(${LIB_TYPE} STREQUAL "SHARED")
set_target_properties(imagerecog
PROPERTIES
DEFINE_SYMBOL ALIBABACLOUD_IMAGERECOG_LIBRARY)
endif()
target_include_directories(imagerecog
PRIVATE include
${CMAKE_SOURCE_DIR}/core/include
)
target_link_libraries(imagerecog
core)
if(CMAKE_HOST_WIN32)
ExternalProject_Get_Property(jsoncpp INSTALL_DIR)
set(jsoncpp_install_dir ${INSTALL_DIR})
add_dependencies(imagerecog
jsoncpp)
target_include_directories(imagerecog
PRIVATE ${jsoncpp_install_dir}/include)
target_link_libraries(imagerecog
${jsoncpp_install_dir}/lib/jsoncpp.lib)
set_target_properties(imagerecog
PROPERTIES
COMPILE_OPTIONS "/bigobj")
else()
target_include_directories(imagerecog
PRIVATE /usr/include/jsoncpp)
target_link_libraries(imagerecog
jsoncpp)
endif()
install(FILES ${imagerecog_public_header}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/imagerecog)
install(FILES ${imagerecog_public_header_model}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/imagerecog/model)
install(TARGETS imagerecog
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)

View File

@@ -0,0 +1,118 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ALIBABACLOUD_IMAGERECOG_IMAGERECOGCLIENT_H_
#define ALIBABACLOUD_IMAGERECOG_IMAGERECOGCLIENT_H_
#include <future>
#include <alibabacloud/core/AsyncCallerContext.h>
#include <alibabacloud/core/EndpointProvider.h>
#include <alibabacloud/core/RpcServiceClient.h>
#include "ImagerecogExport.h"
#include "model/ClassifyingRubbishRequest.h"
#include "model/ClassifyingRubbishResult.h"
#include "model/DetectFruitsRequest.h"
#include "model/DetectFruitsResult.h"
#include "model/DetectImageElementsRequest.h"
#include "model/DetectImageElementsResult.h"
#include "model/RecognizeImageColorRequest.h"
#include "model/RecognizeImageColorResult.h"
#include "model/RecognizeImageStyleRequest.h"
#include "model/RecognizeImageStyleResult.h"
#include "model/RecognizeLogoRequest.h"
#include "model/RecognizeLogoResult.h"
#include "model/RecognizeSceneRequest.h"
#include "model/RecognizeSceneResult.h"
#include "model/RecognizeVehicleTypeRequest.h"
#include "model/RecognizeVehicleTypeResult.h"
#include "model/TaggingImageRequest.h"
#include "model/TaggingImageResult.h"
namespace AlibabaCloud
{
namespace Imagerecog
{
class ALIBABACLOUD_IMAGERECOG_EXPORT ImagerecogClient : public RpcServiceClient
{
public:
typedef Outcome<Error, Model::ClassifyingRubbishResult> ClassifyingRubbishOutcome;
typedef std::future<ClassifyingRubbishOutcome> ClassifyingRubbishOutcomeCallable;
typedef std::function<void(const ImagerecogClient*, const Model::ClassifyingRubbishRequest&, const ClassifyingRubbishOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ClassifyingRubbishAsyncHandler;
typedef Outcome<Error, Model::DetectFruitsResult> DetectFruitsOutcome;
typedef std::future<DetectFruitsOutcome> DetectFruitsOutcomeCallable;
typedef std::function<void(const ImagerecogClient*, const Model::DetectFruitsRequest&, const DetectFruitsOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DetectFruitsAsyncHandler;
typedef Outcome<Error, Model::DetectImageElementsResult> DetectImageElementsOutcome;
typedef std::future<DetectImageElementsOutcome> DetectImageElementsOutcomeCallable;
typedef std::function<void(const ImagerecogClient*, const Model::DetectImageElementsRequest&, const DetectImageElementsOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DetectImageElementsAsyncHandler;
typedef Outcome<Error, Model::RecognizeImageColorResult> RecognizeImageColorOutcome;
typedef std::future<RecognizeImageColorOutcome> RecognizeImageColorOutcomeCallable;
typedef std::function<void(const ImagerecogClient*, const Model::RecognizeImageColorRequest&, const RecognizeImageColorOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RecognizeImageColorAsyncHandler;
typedef Outcome<Error, Model::RecognizeImageStyleResult> RecognizeImageStyleOutcome;
typedef std::future<RecognizeImageStyleOutcome> RecognizeImageStyleOutcomeCallable;
typedef std::function<void(const ImagerecogClient*, const Model::RecognizeImageStyleRequest&, const RecognizeImageStyleOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RecognizeImageStyleAsyncHandler;
typedef Outcome<Error, Model::RecognizeLogoResult> RecognizeLogoOutcome;
typedef std::future<RecognizeLogoOutcome> RecognizeLogoOutcomeCallable;
typedef std::function<void(const ImagerecogClient*, const Model::RecognizeLogoRequest&, const RecognizeLogoOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RecognizeLogoAsyncHandler;
typedef Outcome<Error, Model::RecognizeSceneResult> RecognizeSceneOutcome;
typedef std::future<RecognizeSceneOutcome> RecognizeSceneOutcomeCallable;
typedef std::function<void(const ImagerecogClient*, const Model::RecognizeSceneRequest&, const RecognizeSceneOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RecognizeSceneAsyncHandler;
typedef Outcome<Error, Model::RecognizeVehicleTypeResult> RecognizeVehicleTypeOutcome;
typedef std::future<RecognizeVehicleTypeOutcome> RecognizeVehicleTypeOutcomeCallable;
typedef std::function<void(const ImagerecogClient*, const Model::RecognizeVehicleTypeRequest&, const RecognizeVehicleTypeOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RecognizeVehicleTypeAsyncHandler;
typedef Outcome<Error, Model::TaggingImageResult> TaggingImageOutcome;
typedef std::future<TaggingImageOutcome> TaggingImageOutcomeCallable;
typedef std::function<void(const ImagerecogClient*, const Model::TaggingImageRequest&, const TaggingImageOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> TaggingImageAsyncHandler;
ImagerecogClient(const Credentials &credentials, const ClientConfiguration &configuration);
ImagerecogClient(const std::shared_ptr<CredentialsProvider> &credentialsProvider, const ClientConfiguration &configuration);
ImagerecogClient(const std::string &accessKeyId, const std::string &accessKeySecret, const ClientConfiguration &configuration);
~ImagerecogClient();
ClassifyingRubbishOutcome classifyingRubbish(const Model::ClassifyingRubbishRequest &request)const;
void classifyingRubbishAsync(const Model::ClassifyingRubbishRequest& request, const ClassifyingRubbishAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
ClassifyingRubbishOutcomeCallable classifyingRubbishCallable(const Model::ClassifyingRubbishRequest& request) const;
DetectFruitsOutcome detectFruits(const Model::DetectFruitsRequest &request)const;
void detectFruitsAsync(const Model::DetectFruitsRequest& request, const DetectFruitsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
DetectFruitsOutcomeCallable detectFruitsCallable(const Model::DetectFruitsRequest& request) const;
DetectImageElementsOutcome detectImageElements(const Model::DetectImageElementsRequest &request)const;
void detectImageElementsAsync(const Model::DetectImageElementsRequest& request, const DetectImageElementsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
DetectImageElementsOutcomeCallable detectImageElementsCallable(const Model::DetectImageElementsRequest& request) const;
RecognizeImageColorOutcome recognizeImageColor(const Model::RecognizeImageColorRequest &request)const;
void recognizeImageColorAsync(const Model::RecognizeImageColorRequest& request, const RecognizeImageColorAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
RecognizeImageColorOutcomeCallable recognizeImageColorCallable(const Model::RecognizeImageColorRequest& request) const;
RecognizeImageStyleOutcome recognizeImageStyle(const Model::RecognizeImageStyleRequest &request)const;
void recognizeImageStyleAsync(const Model::RecognizeImageStyleRequest& request, const RecognizeImageStyleAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
RecognizeImageStyleOutcomeCallable recognizeImageStyleCallable(const Model::RecognizeImageStyleRequest& request) const;
RecognizeLogoOutcome recognizeLogo(const Model::RecognizeLogoRequest &request)const;
void recognizeLogoAsync(const Model::RecognizeLogoRequest& request, const RecognizeLogoAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
RecognizeLogoOutcomeCallable recognizeLogoCallable(const Model::RecognizeLogoRequest& request) const;
RecognizeSceneOutcome recognizeScene(const Model::RecognizeSceneRequest &request)const;
void recognizeSceneAsync(const Model::RecognizeSceneRequest& request, const RecognizeSceneAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
RecognizeSceneOutcomeCallable recognizeSceneCallable(const Model::RecognizeSceneRequest& request) const;
RecognizeVehicleTypeOutcome recognizeVehicleType(const Model::RecognizeVehicleTypeRequest &request)const;
void recognizeVehicleTypeAsync(const Model::RecognizeVehicleTypeRequest& request, const RecognizeVehicleTypeAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
RecognizeVehicleTypeOutcomeCallable recognizeVehicleTypeCallable(const Model::RecognizeVehicleTypeRequest& request) const;
TaggingImageOutcome taggingImage(const Model::TaggingImageRequest &request)const;
void taggingImageAsync(const Model::TaggingImageRequest& request, const TaggingImageAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
TaggingImageOutcomeCallable taggingImageCallable(const Model::TaggingImageRequest& request) const;
private:
std::shared_ptr<EndpointProvider> endpointProvider_;
};
}
}
#endif // !ALIBABACLOUD_IMAGERECOG_IMAGERECOGCLIENT_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_IMAGERECOG_IMAGERECOGEXPORT_H_
#define ALIBABACLOUD_IMAGERECOG_IMAGERECOGEXPORT_H_
#include <alibabacloud/core/Global.h>
#if defined(ALIBABACLOUD_SHARED)
# if defined(ALIBABACLOUD_IMAGERECOG_LIBRARY)
# define ALIBABACLOUD_IMAGERECOG_EXPORT ALIBABACLOUD_DECL_EXPORT
# else
# define ALIBABACLOUD_IMAGERECOG_EXPORT ALIBABACLOUD_DECL_IMPORT
# endif
#else
# define ALIBABACLOUD_IMAGERECOG_EXPORT
#endif
#endif // !ALIBABACLOUD_IMAGERECOG_IMAGERECOGEXPORT_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_IMAGERECOG_MODEL_CLASSIFYINGRUBBISHREQUEST_H_
#define ALIBABACLOUD_IMAGERECOG_MODEL_CLASSIFYINGRUBBISHREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/imagerecog/ImagerecogExport.h>
namespace AlibabaCloud
{
namespace Imagerecog
{
namespace Model
{
class ALIBABACLOUD_IMAGERECOG_EXPORT ClassifyingRubbishRequest : public RpcServiceRequest
{
public:
ClassifyingRubbishRequest();
~ClassifyingRubbishRequest();
std::string getImageURL()const;
void setImageURL(const std::string& imageURL);
private:
std::string imageURL_;
};
}
}
}
#endif // !ALIBABACLOUD_IMAGERECOG_MODEL_CLASSIFYINGRUBBISHREQUEST_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_IMAGERECOG_MODEL_CLASSIFYINGRUBBISHRESULT_H_
#define ALIBABACLOUD_IMAGERECOG_MODEL_CLASSIFYINGRUBBISHRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/imagerecog/ImagerecogExport.h>
namespace AlibabaCloud
{
namespace Imagerecog
{
namespace Model
{
class ALIBABACLOUD_IMAGERECOG_EXPORT ClassifyingRubbishResult : public ServiceResult
{
public:
struct Data
{
struct Element
{
std::string rubbish;
std::string category;
float categoryScore;
float rubbishScore;
};
bool sensitive;
std::vector<Element> elements;
};
ClassifyingRubbishResult();
explicit ClassifyingRubbishResult(const std::string &payload);
~ClassifyingRubbishResult();
Data getData()const;
protected:
void parse(const std::string &payload);
private:
Data data_;
};
}
}
}
#endif // !ALIBABACLOUD_IMAGERECOG_MODEL_CLASSIFYINGRUBBISHRESULT_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_IMAGERECOG_MODEL_DETECTFRUITSREQUEST_H_
#define ALIBABACLOUD_IMAGERECOG_MODEL_DETECTFRUITSREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/imagerecog/ImagerecogExport.h>
namespace AlibabaCloud
{
namespace Imagerecog
{
namespace Model
{
class ALIBABACLOUD_IMAGERECOG_EXPORT DetectFruitsRequest : public RpcServiceRequest
{
public:
DetectFruitsRequest();
~DetectFruitsRequest();
std::string getImageURL()const;
void setImageURL(const std::string& imageURL);
private:
std::string imageURL_;
};
}
}
}
#endif // !ALIBABACLOUD_IMAGERECOG_MODEL_DETECTFRUITSREQUEST_H_

View File

@@ -0,0 +1,61 @@
/*
* 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_IMAGERECOG_MODEL_DETECTFRUITSRESULT_H_
#define ALIBABACLOUD_IMAGERECOG_MODEL_DETECTFRUITSRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/imagerecog/ImagerecogExport.h>
namespace AlibabaCloud
{
namespace Imagerecog
{
namespace Model
{
class ALIBABACLOUD_IMAGERECOG_EXPORT DetectFruitsResult : public ServiceResult
{
public:
struct Data
{
struct Element
{
float score;
std::vector<std::string> box;
std::string name;
};
std::vector<Element> elements;
};
DetectFruitsResult();
explicit DetectFruitsResult(const std::string &payload);
~DetectFruitsResult();
Data getData()const;
protected:
void parse(const std::string &payload);
private:
Data data_;
};
}
}
}
#endif // !ALIBABACLOUD_IMAGERECOG_MODEL_DETECTFRUITSRESULT_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_IMAGERECOG_MODEL_DETECTIMAGEELEMENTSREQUEST_H_
#define ALIBABACLOUD_IMAGERECOG_MODEL_DETECTIMAGEELEMENTSREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/imagerecog/ImagerecogExport.h>
namespace AlibabaCloud
{
namespace Imagerecog
{
namespace Model
{
class ALIBABACLOUD_IMAGERECOG_EXPORT DetectImageElementsRequest : public RpcServiceRequest
{
public:
DetectImageElementsRequest();
~DetectImageElementsRequest();
std::string getUrl()const;
void setUrl(const std::string& url);
private:
std::string url_;
};
}
}
}
#endif // !ALIBABACLOUD_IMAGERECOG_MODEL_DETECTIMAGEELEMENTSREQUEST_H_

View File

@@ -0,0 +1,64 @@
/*
* 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_IMAGERECOG_MODEL_DETECTIMAGEELEMENTSRESULT_H_
#define ALIBABACLOUD_IMAGERECOG_MODEL_DETECTIMAGEELEMENTSRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/imagerecog/ImagerecogExport.h>
namespace AlibabaCloud
{
namespace Imagerecog
{
namespace Model
{
class ALIBABACLOUD_IMAGERECOG_EXPORT DetectImageElementsResult : public ServiceResult
{
public:
struct Data
{
struct Element
{
std::string type;
float score;
int x;
int y;
int height;
int width;
};
std::vector<Element> elements;
};
DetectImageElementsResult();
explicit DetectImageElementsResult(const std::string &payload);
~DetectImageElementsResult();
Data getData()const;
protected:
void parse(const std::string &payload);
private:
Data data_;
};
}
}
}
#endif // !ALIBABACLOUD_IMAGERECOG_MODEL_DETECTIMAGEELEMENTSRESULT_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_IMAGERECOG_MODEL_RECOGNIZEIMAGECOLORREQUEST_H_
#define ALIBABACLOUD_IMAGERECOG_MODEL_RECOGNIZEIMAGECOLORREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/imagerecog/ImagerecogExport.h>
namespace AlibabaCloud
{
namespace Imagerecog
{
namespace Model
{
class ALIBABACLOUD_IMAGERECOG_EXPORT RecognizeImageColorRequest : public RpcServiceRequest
{
public:
RecognizeImageColorRequest();
~RecognizeImageColorRequest();
std::string getUrl()const;
void setUrl(const std::string& url);
int getColorCount()const;
void setColorCount(int colorCount);
private:
std::string url_;
int colorCount_;
};
}
}
}
#endif // !ALIBABACLOUD_IMAGERECOG_MODEL_RECOGNIZEIMAGECOLORREQUEST_H_

View File

@@ -0,0 +1,61 @@
/*
* 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_IMAGERECOG_MODEL_RECOGNIZEIMAGECOLORRESULT_H_
#define ALIBABACLOUD_IMAGERECOG_MODEL_RECOGNIZEIMAGECOLORRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/imagerecog/ImagerecogExport.h>
namespace AlibabaCloud
{
namespace Imagerecog
{
namespace Model
{
class ALIBABACLOUD_IMAGERECOG_EXPORT RecognizeImageColorResult : public ServiceResult
{
public:
struct Data
{
struct ColorTemplate
{
float percentage;
std::string color;
std::string label;
};
std::vector<ColorTemplate> colorTemplateList;
};
RecognizeImageColorResult();
explicit RecognizeImageColorResult(const std::string &payload);
~RecognizeImageColorResult();
Data getData()const;
protected:
void parse(const std::string &payload);
private:
Data data_;
};
}
}
}
#endif // !ALIBABACLOUD_IMAGERECOG_MODEL_RECOGNIZEIMAGECOLORRESULT_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_IMAGERECOG_MODEL_RECOGNIZEIMAGESTYLEREQUEST_H_
#define ALIBABACLOUD_IMAGERECOG_MODEL_RECOGNIZEIMAGESTYLEREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/imagerecog/ImagerecogExport.h>
namespace AlibabaCloud
{
namespace Imagerecog
{
namespace Model
{
class ALIBABACLOUD_IMAGERECOG_EXPORT RecognizeImageStyleRequest : public RpcServiceRequest
{
public:
RecognizeImageStyleRequest();
~RecognizeImageStyleRequest();
std::string getUrl()const;
void setUrl(const std::string& url);
private:
std::string url_;
};
}
}
}
#endif // !ALIBABACLOUD_IMAGERECOG_MODEL_RECOGNIZEIMAGESTYLEREQUEST_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_IMAGERECOG_MODEL_RECOGNIZEIMAGESTYLERESULT_H_
#define ALIBABACLOUD_IMAGERECOG_MODEL_RECOGNIZEIMAGESTYLERESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/imagerecog/ImagerecogExport.h>
namespace AlibabaCloud
{
namespace Imagerecog
{
namespace Model
{
class ALIBABACLOUD_IMAGERECOG_EXPORT RecognizeImageStyleResult : public ServiceResult
{
public:
struct Data
{
std::vector<std::string> styles;
};
RecognizeImageStyleResult();
explicit RecognizeImageStyleResult(const std::string &payload);
~RecognizeImageStyleResult();
Data getData()const;
protected:
void parse(const std::string &payload);
private:
Data data_;
};
}
}
}
#endif // !ALIBABACLOUD_IMAGERECOG_MODEL_RECOGNIZEIMAGESTYLERESULT_H_

View File

@@ -0,0 +1,53 @@
/*
* 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_IMAGERECOG_MODEL_RECOGNIZELOGOREQUEST_H_
#define ALIBABACLOUD_IMAGERECOG_MODEL_RECOGNIZELOGOREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/imagerecog/ImagerecogExport.h>
namespace AlibabaCloud
{
namespace Imagerecog
{
namespace Model
{
class ALIBABACLOUD_IMAGERECOG_EXPORT RecognizeLogoRequest : public RpcServiceRequest
{
public:
struct Tasks
{
std::string imageURL;
};
public:
RecognizeLogoRequest();
~RecognizeLogoRequest();
std::vector<Tasks> getTasks()const;
void setTasks(const std::vector<Tasks>& tasks);
private:
std::vector<Tasks> tasks_;
};
}
}
}
#endif // !ALIBABACLOUD_IMAGERECOG_MODEL_RECOGNIZELOGOREQUEST_H_

View File

@@ -0,0 +1,77 @@
/*
* 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_IMAGERECOG_MODEL_RECOGNIZELOGORESULT_H_
#define ALIBABACLOUD_IMAGERECOG_MODEL_RECOGNIZELOGORESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/imagerecog/ImagerecogExport.h>
namespace AlibabaCloud
{
namespace Imagerecog
{
namespace Model
{
class ALIBABACLOUD_IMAGERECOG_EXPORT RecognizeLogoResult : public ServiceResult
{
public:
struct Data
{
struct Element
{
struct Result
{
struct LogoData
{
std::string type;
float w;
float x;
float h;
float y;
std::string name;
};
std::string suggestion;
std::vector<Result::LogoData> logosData;
float rate;
std::string label;
};
std::string taskId;
std::vector<Element::Result> results;
std::string imageURL;
};
std::vector<Element> elements;
};
RecognizeLogoResult();
explicit RecognizeLogoResult(const std::string &payload);
~RecognizeLogoResult();
Data getData()const;
protected:
void parse(const std::string &payload);
private:
Data data_;
};
}
}
}
#endif // !ALIBABACLOUD_IMAGERECOG_MODEL_RECOGNIZELOGORESULT_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_IMAGERECOG_MODEL_RECOGNIZESCENEREQUEST_H_
#define ALIBABACLOUD_IMAGERECOG_MODEL_RECOGNIZESCENEREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/imagerecog/ImagerecogExport.h>
namespace AlibabaCloud
{
namespace Imagerecog
{
namespace Model
{
class ALIBABACLOUD_IMAGERECOG_EXPORT RecognizeSceneRequest : public RpcServiceRequest
{
public:
RecognizeSceneRequest();
~RecognizeSceneRequest();
int getImageType()const;
void setImageType(int imageType);
std::string getImageURL()const;
void setImageURL(const std::string& imageURL);
private:
int imageType_;
std::string imageURL_;
};
}
}
}
#endif // !ALIBABACLOUD_IMAGERECOG_MODEL_RECOGNIZESCENEREQUEST_H_

View File

@@ -0,0 +1,60 @@
/*
* 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_IMAGERECOG_MODEL_RECOGNIZESCENERESULT_H_
#define ALIBABACLOUD_IMAGERECOG_MODEL_RECOGNIZESCENERESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/imagerecog/ImagerecogExport.h>
namespace AlibabaCloud
{
namespace Imagerecog
{
namespace Model
{
class ALIBABACLOUD_IMAGERECOG_EXPORT RecognizeSceneResult : public ServiceResult
{
public:
struct Data
{
struct Tag
{
float confidence;
std::string value;
};
std::vector<Tag> tags;
};
RecognizeSceneResult();
explicit RecognizeSceneResult(const std::string &payload);
~RecognizeSceneResult();
Data getData()const;
protected:
void parse(const std::string &payload);
private:
Data data_;
};
}
}
}
#endif // !ALIBABACLOUD_IMAGERECOG_MODEL_RECOGNIZESCENERESULT_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_IMAGERECOG_MODEL_RECOGNIZEVEHICLETYPEREQUEST_H_
#define ALIBABACLOUD_IMAGERECOG_MODEL_RECOGNIZEVEHICLETYPEREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/imagerecog/ImagerecogExport.h>
namespace AlibabaCloud
{
namespace Imagerecog
{
namespace Model
{
class ALIBABACLOUD_IMAGERECOG_EXPORT RecognizeVehicleTypeRequest : public RpcServiceRequest
{
public:
RecognizeVehicleTypeRequest();
~RecognizeVehicleTypeRequest();
std::string getImageURL()const;
void setImageURL(const std::string& imageURL);
private:
std::string imageURL_;
};
}
}
}
#endif // !ALIBABACLOUD_IMAGERECOG_MODEL_RECOGNIZEVEHICLETYPEREQUEST_H_

View File

@@ -0,0 +1,61 @@
/*
* 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_IMAGERECOG_MODEL_RECOGNIZEVEHICLETYPERESULT_H_
#define ALIBABACLOUD_IMAGERECOG_MODEL_RECOGNIZEVEHICLETYPERESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/imagerecog/ImagerecogExport.h>
namespace AlibabaCloud
{
namespace Imagerecog
{
namespace Model
{
class ALIBABACLOUD_IMAGERECOG_EXPORT RecognizeVehicleTypeResult : public ServiceResult
{
public:
struct Data
{
struct Element
{
float score;
std::string name;
};
std::vector<Element> elements;
float threshold;
};
RecognizeVehicleTypeResult();
explicit RecognizeVehicleTypeResult(const std::string &payload);
~RecognizeVehicleTypeResult();
Data getData()const;
protected:
void parse(const std::string &payload);
private:
Data data_;
};
}
}
}
#endif // !ALIBABACLOUD_IMAGERECOG_MODEL_RECOGNIZEVEHICLETYPERESULT_H_

Some files were not shown because too many files have changed in this diff Show More