Compare commits

...

13 Commits

Author SHA1 Message Date
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
187 changed files with 8587 additions and 791 deletions

View File

@@ -1,3 +1,44 @@
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_;
}

View File

@@ -47,6 +47,10 @@ set(imageseg_public_header_model
include/alibabacloud/imageseg/model/SegmentFurnitureResult.h
include/alibabacloud/imageseg/model/SegmentHDBodyRequest.h
include/alibabacloud/imageseg/model/SegmentHDBodyResult.h
include/alibabacloud/imageseg/model/SegmentHDCommonImageRequest.h
include/alibabacloud/imageseg/model/SegmentHDCommonImageResult.h
include/alibabacloud/imageseg/model/SegmentHDSkyRequest.h
include/alibabacloud/imageseg/model/SegmentHDSkyResult.h
include/alibabacloud/imageseg/model/SegmentHairRequest.h
include/alibabacloud/imageseg/model/SegmentHairResult.h
include/alibabacloud/imageseg/model/SegmentHeadRequest.h
@@ -90,6 +94,10 @@ set(imageseg_src
src/model/SegmentFurnitureResult.cc
src/model/SegmentHDBodyRequest.cc
src/model/SegmentHDBodyResult.cc
src/model/SegmentHDCommonImageRequest.cc
src/model/SegmentHDCommonImageResult.cc
src/model/SegmentHDSkyRequest.cc
src/model/SegmentHDSkyResult.cc
src/model/SegmentHairRequest.cc
src/model/SegmentHairResult.cc
src/model/SegmentHeadRequest.cc

View File

@@ -48,6 +48,10 @@
#include "model/SegmentFurnitureResult.h"
#include "model/SegmentHDBodyRequest.h"
#include "model/SegmentHDBodyResult.h"
#include "model/SegmentHDCommonImageRequest.h"
#include "model/SegmentHDCommonImageResult.h"
#include "model/SegmentHDSkyRequest.h"
#include "model/SegmentHDSkyResult.h"
#include "model/SegmentHairRequest.h"
#include "model/SegmentHairResult.h"
#include "model/SegmentHeadRequest.h"
@@ -110,6 +114,12 @@ namespace AlibabaCloud
typedef Outcome<Error, Model::SegmentHDBodyResult> SegmentHDBodyOutcome;
typedef std::future<SegmentHDBodyOutcome> SegmentHDBodyOutcomeCallable;
typedef std::function<void(const ImagesegClient*, const Model::SegmentHDBodyRequest&, const SegmentHDBodyOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> SegmentHDBodyAsyncHandler;
typedef Outcome<Error, Model::SegmentHDCommonImageResult> SegmentHDCommonImageOutcome;
typedef std::future<SegmentHDCommonImageOutcome> SegmentHDCommonImageOutcomeCallable;
typedef std::function<void(const ImagesegClient*, const Model::SegmentHDCommonImageRequest&, const SegmentHDCommonImageOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> SegmentHDCommonImageAsyncHandler;
typedef Outcome<Error, Model::SegmentHDSkyResult> SegmentHDSkyOutcome;
typedef std::future<SegmentHDSkyOutcome> SegmentHDSkyOutcomeCallable;
typedef std::function<void(const ImagesegClient*, const Model::SegmentHDSkyRequest&, const SegmentHDSkyOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> SegmentHDSkyAsyncHandler;
typedef Outcome<Error, Model::SegmentHairResult> SegmentHairOutcome;
typedef std::future<SegmentHairOutcome> SegmentHairOutcomeCallable;
typedef std::function<void(const ImagesegClient*, const Model::SegmentHairRequest&, const SegmentHairOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> SegmentHairAsyncHandler;
@@ -175,6 +185,12 @@ namespace AlibabaCloud
SegmentHDBodyOutcome segmentHDBody(const Model::SegmentHDBodyRequest &request)const;
void segmentHDBodyAsync(const Model::SegmentHDBodyRequest& request, const SegmentHDBodyAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
SegmentHDBodyOutcomeCallable segmentHDBodyCallable(const Model::SegmentHDBodyRequest& request) const;
SegmentHDCommonImageOutcome segmentHDCommonImage(const Model::SegmentHDCommonImageRequest &request)const;
void segmentHDCommonImageAsync(const Model::SegmentHDCommonImageRequest& request, const SegmentHDCommonImageAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
SegmentHDCommonImageOutcomeCallable segmentHDCommonImageCallable(const Model::SegmentHDCommonImageRequest& request) const;
SegmentHDSkyOutcome segmentHDSky(const Model::SegmentHDSkyRequest &request)const;
void segmentHDSkyAsync(const Model::SegmentHDSkyRequest& request, const SegmentHDSkyAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
SegmentHDSkyOutcomeCallable segmentHDSkyCallable(const Model::SegmentHDSkyRequest& request) const;
SegmentHairOutcome segmentHair(const Model::SegmentHairRequest &request)const;
void segmentHairAsync(const Model::SegmentHairRequest& request, const SegmentHairAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
SegmentHairOutcomeCallable segmentHairCallable(const Model::SegmentHairRequest& 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_IMAGESEG_MODEL_SEGMENTHDCOMMONIMAGEREQUEST_H_
#define ALIBABACLOUD_IMAGESEG_MODEL_SEGMENTHDCOMMONIMAGEREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/imageseg/ImagesegExport.h>
namespace AlibabaCloud
{
namespace Imageseg
{
namespace Model
{
class ALIBABACLOUD_IMAGESEG_EXPORT SegmentHDCommonImageRequest : public RpcServiceRequest
{
public:
SegmentHDCommonImageRequest();
~SegmentHDCommonImageRequest();
bool getAsync()const;
void setAsync(bool async);
std::string getImageUrl()const;
void setImageUrl(const std::string& imageUrl);
private:
bool async_;
std::string imageUrl_;
};
}
}
}
#endif // !ALIBABACLOUD_IMAGESEG_MODEL_SEGMENTHDCOMMONIMAGEREQUEST_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_IMAGESEG_MODEL_SEGMENTHDCOMMONIMAGERESULT_H_
#define ALIBABACLOUD_IMAGESEG_MODEL_SEGMENTHDCOMMONIMAGERESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/imageseg/ImagesegExport.h>
namespace AlibabaCloud
{
namespace Imageseg
{
namespace Model
{
class ALIBABACLOUD_IMAGESEG_EXPORT SegmentHDCommonImageResult : public ServiceResult
{
public:
struct Data
{
std::string imageUrl;
};
SegmentHDCommonImageResult();
explicit SegmentHDCommonImageResult(const std::string &payload);
~SegmentHDCommonImageResult();
Data getData()const;
protected:
void parse(const std::string &payload);
private:
Data data_;
};
}
}
}
#endif // !ALIBABACLOUD_IMAGESEG_MODEL_SEGMENTHDCOMMONIMAGERESULT_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_IMAGESEG_MODEL_SEGMENTHDSKYREQUEST_H_
#define ALIBABACLOUD_IMAGESEG_MODEL_SEGMENTHDSKYREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/imageseg/ImagesegExport.h>
namespace AlibabaCloud
{
namespace Imageseg
{
namespace Model
{
class ALIBABACLOUD_IMAGESEG_EXPORT SegmentHDSkyRequest : public RpcServiceRequest
{
public:
SegmentHDSkyRequest();
~SegmentHDSkyRequest();
std::string getImageURL()const;
void setImageURL(const std::string& imageURL);
private:
std::string imageURL_;
};
}
}
}
#endif // !ALIBABACLOUD_IMAGESEG_MODEL_SEGMENTHDSKYREQUEST_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_IMAGESEG_MODEL_SEGMENTHDSKYRESULT_H_
#define ALIBABACLOUD_IMAGESEG_MODEL_SEGMENTHDSKYRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/imageseg/ImagesegExport.h>
namespace AlibabaCloud
{
namespace Imageseg
{
namespace Model
{
class ALIBABACLOUD_IMAGESEG_EXPORT SegmentHDSkyResult : public ServiceResult
{
public:
struct Data
{
std::string imageURL;
};
SegmentHDSkyResult();
explicit SegmentHDSkyResult(const std::string &payload);
~SegmentHDSkyResult();
Data getData()const;
protected:
void parse(const std::string &payload);
private:
Data data_;
};
}
}
}
#endif // !ALIBABACLOUD_IMAGESEG_MODEL_SEGMENTHDSKYRESULT_H_

View File

@@ -519,6 +519,78 @@ ImagesegClient::SegmentHDBodyOutcomeCallable ImagesegClient::segmentHDBodyCallab
return task->get_future();
}
ImagesegClient::SegmentHDCommonImageOutcome ImagesegClient::segmentHDCommonImage(const SegmentHDCommonImageRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return SegmentHDCommonImageOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return SegmentHDCommonImageOutcome(SegmentHDCommonImageResult(outcome.result()));
else
return SegmentHDCommonImageOutcome(outcome.error());
}
void ImagesegClient::segmentHDCommonImageAsync(const SegmentHDCommonImageRequest& request, const SegmentHDCommonImageAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, segmentHDCommonImage(request), context);
};
asyncExecute(new Runnable(fn));
}
ImagesegClient::SegmentHDCommonImageOutcomeCallable ImagesegClient::segmentHDCommonImageCallable(const SegmentHDCommonImageRequest &request) const
{
auto task = std::make_shared<std::packaged_task<SegmentHDCommonImageOutcome()>>(
[this, request]()
{
return this->segmentHDCommonImage(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
ImagesegClient::SegmentHDSkyOutcome ImagesegClient::segmentHDSky(const SegmentHDSkyRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return SegmentHDSkyOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return SegmentHDSkyOutcome(SegmentHDSkyResult(outcome.result()));
else
return SegmentHDSkyOutcome(outcome.error());
}
void ImagesegClient::segmentHDSkyAsync(const SegmentHDSkyRequest& request, const SegmentHDSkyAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, segmentHDSky(request), context);
};
asyncExecute(new Runnable(fn));
}
ImagesegClient::SegmentHDSkyOutcomeCallable ImagesegClient::segmentHDSkyCallable(const SegmentHDSkyRequest &request) const
{
auto task = std::make_shared<std::packaged_task<SegmentHDSkyOutcome()>>(
[this, request]()
{
return this->segmentHDSky(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
ImagesegClient::SegmentHairOutcome ImagesegClient::segmentHair(const SegmentHairRequest &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/imageseg/model/SegmentHDCommonImageRequest.h>
using AlibabaCloud::Imageseg::Model::SegmentHDCommonImageRequest;
SegmentHDCommonImageRequest::SegmentHDCommonImageRequest() :
RpcServiceRequest("imageseg", "2019-12-30", "SegmentHDCommonImage")
{
setMethod(HttpRequest::Method::Post);
}
SegmentHDCommonImageRequest::~SegmentHDCommonImageRequest()
{}
bool SegmentHDCommonImageRequest::getAsync()const
{
return async_;
}
void SegmentHDCommonImageRequest::setAsync(bool async)
{
async_ = async;
setBodyParameter("Async", async ? "true" : "false");
}
std::string SegmentHDCommonImageRequest::getImageUrl()const
{
return imageUrl_;
}
void SegmentHDCommonImageRequest::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/imageseg/model/SegmentHDCommonImageResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Imageseg;
using namespace AlibabaCloud::Imageseg::Model;
SegmentHDCommonImageResult::SegmentHDCommonImageResult() :
ServiceResult()
{}
SegmentHDCommonImageResult::SegmentHDCommonImageResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
SegmentHDCommonImageResult::~SegmentHDCommonImageResult()
{}
void SegmentHDCommonImageResult::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();
}
SegmentHDCommonImageResult::Data SegmentHDCommonImageResult::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/imageseg/model/SegmentHDSkyRequest.h>
using AlibabaCloud::Imageseg::Model::SegmentHDSkyRequest;
SegmentHDSkyRequest::SegmentHDSkyRequest() :
RpcServiceRequest("imageseg", "2019-12-30", "SegmentHDSky")
{
setMethod(HttpRequest::Method::Post);
}
SegmentHDSkyRequest::~SegmentHDSkyRequest()
{}
std::string SegmentHDSkyRequest::getImageURL()const
{
return imageURL_;
}
void SegmentHDSkyRequest::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/imageseg/model/SegmentHDSkyResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Imageseg;
using namespace AlibabaCloud::Imageseg::Model;
SegmentHDSkyResult::SegmentHDSkyResult() :
ServiceResult()
{}
SegmentHDSkyResult::SegmentHDSkyResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
SegmentHDSkyResult::~SegmentHDSkyResult()
{}
void SegmentHDSkyResult::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();
}
SegmentHDSkyResult::Data SegmentHDSkyResult::getData()const
{
return data_;
}

View File

@@ -45,6 +45,17 @@ namespace AlibabaCloud
std::string district;
std::string province;
};
struct Tag
{
std::string artist;
std::string composer;
std::string performer;
std::string language;
std::string creationTime;
std::string album;
std::string title;
std::string albumArtist;
};
Address address;
int numberStreams;
std::string size;
@@ -53,6 +64,7 @@ namespace AlibabaCloud
std::string creationTime;
std::string formatName;
std::string duration;
Tag tag;
std::string bitrate;
int numberPrograms;
std::string location;

View File

@@ -45,12 +45,12 @@ void DetectQRCodesResult::parse(const std::string &payload)
SuccessDetailsItem successDetailsObject;
if(!valueSuccessDetailsSuccessDetailsItem["SrcUri"].isNull())
successDetailsObject.srcUri = valueSuccessDetailsSuccessDetailsItem["SrcUri"].asString();
auto allQRCodesNode = allSuccessDetailsNode["QRCodes"]["QRCodesItem"];
for (auto allSuccessDetailsNodeQRCodesQRCodesItem : allQRCodesNode)
auto allQRCodesNode = valueSuccessDetailsSuccessDetailsItem["QRCodes"]["QRCodesItem"];
for (auto valueSuccessDetailsSuccessDetailsItemQRCodesQRCodesItem : allQRCodesNode)
{
SuccessDetailsItem::QRCodesItem qRCodesObject;
if(!allSuccessDetailsNodeQRCodesQRCodesItem["Content"].isNull())
qRCodesObject.content = allSuccessDetailsNodeQRCodesQRCodesItem["Content"].asString();
if(!valueSuccessDetailsSuccessDetailsItemQRCodesQRCodesItem["Content"].isNull())
qRCodesObject.content = valueSuccessDetailsSuccessDetailsItemQRCodesQRCodesItem["Content"].asString();
auto qRCodesRectangleNode = value["QRCodesRectangle"];
if(!qRCodesRectangleNode["Left"].isNull())
qRCodesObject.qRCodesRectangle.left = qRCodesRectangleNode["Left"].asString();

View File

@@ -127,14 +127,14 @@ void FindImagesResult::parse(const std::string &payload)
imagesObject.croppingSuggestionFailReason = valueImagesImagesItem["CroppingSuggestionFailReason"].asString();
if(!valueImagesImagesItem["CroppingSuggestionModifyTime"].isNull())
imagesObject.croppingSuggestionModifyTime = valueImagesImagesItem["CroppingSuggestionModifyTime"].asString();
auto allCroppingSuggestionNode = allImagesNode["CroppingSuggestion"]["CroppingSuggestionItem"];
for (auto allImagesNodeCroppingSuggestionCroppingSuggestionItem : allCroppingSuggestionNode)
auto allCroppingSuggestionNode = valueImagesImagesItem["CroppingSuggestion"]["CroppingSuggestionItem"];
for (auto valueImagesImagesItemCroppingSuggestionCroppingSuggestionItem : allCroppingSuggestionNode)
{
ImagesItem::CroppingSuggestionItem croppingSuggestionObject;
if(!allImagesNodeCroppingSuggestionCroppingSuggestionItem["AspectRatio"].isNull())
croppingSuggestionObject.aspectRatio = allImagesNodeCroppingSuggestionCroppingSuggestionItem["AspectRatio"].asString();
if(!allImagesNodeCroppingSuggestionCroppingSuggestionItem["Score"].isNull())
croppingSuggestionObject.score = std::stof(allImagesNodeCroppingSuggestionCroppingSuggestionItem["Score"].asString());
if(!valueImagesImagesItemCroppingSuggestionCroppingSuggestionItem["AspectRatio"].isNull())
croppingSuggestionObject.aspectRatio = valueImagesImagesItemCroppingSuggestionCroppingSuggestionItem["AspectRatio"].asString();
if(!valueImagesImagesItemCroppingSuggestionCroppingSuggestionItem["Score"].isNull())
croppingSuggestionObject.score = std::stof(valueImagesImagesItemCroppingSuggestionCroppingSuggestionItem["Score"].asString());
auto croppingBoundaryNode = value["CroppingBoundary"];
if(!croppingBoundaryNode["Width"].isNull())
croppingSuggestionObject.croppingBoundary.width = std::stoi(croppingBoundaryNode["Width"].asString());
@@ -146,30 +146,30 @@ void FindImagesResult::parse(const std::string &payload)
croppingSuggestionObject.croppingBoundary.top = std::stoi(croppingBoundaryNode["Top"].asString());
imagesObject.croppingSuggestion.push_back(croppingSuggestionObject);
}
auto allFacesNode = allImagesNode["Faces"]["FacesItem"];
for (auto allImagesNodeFacesFacesItem : allFacesNode)
auto allFacesNode = valueImagesImagesItem["Faces"]["FacesItem"];
for (auto valueImagesImagesItemFacesFacesItem : allFacesNode)
{
ImagesItem::FacesItem facesObject;
if(!allImagesNodeFacesFacesItem["Age"].isNull())
facesObject.age = std::stoi(allImagesNodeFacesFacesItem["Age"].asString());
if(!allImagesNodeFacesFacesItem["GenderConfidence"].isNull())
facesObject.genderConfidence = std::stof(allImagesNodeFacesFacesItem["GenderConfidence"].asString());
if(!allImagesNodeFacesFacesItem["Attractive"].isNull())
facesObject.attractive = std::stof(allImagesNodeFacesFacesItem["Attractive"].asString());
if(!allImagesNodeFacesFacesItem["Gender"].isNull())
facesObject.gender = allImagesNodeFacesFacesItem["Gender"].asString();
if(!allImagesNodeFacesFacesItem["FaceConfidence"].isNull())
facesObject.faceConfidence = std::stof(allImagesNodeFacesFacesItem["FaceConfidence"].asString());
if(!allImagesNodeFacesFacesItem["Emotion"].isNull())
facesObject.emotion = allImagesNodeFacesFacesItem["Emotion"].asString();
if(!allImagesNodeFacesFacesItem["FaceId"].isNull())
facesObject.faceId = allImagesNodeFacesFacesItem["FaceId"].asString();
if(!allImagesNodeFacesFacesItem["EmotionConfidence"].isNull())
facesObject.emotionConfidence = std::stof(allImagesNodeFacesFacesItem["EmotionConfidence"].asString());
if(!allImagesNodeFacesFacesItem["GroupId"].isNull())
facesObject.groupId = allImagesNodeFacesFacesItem["GroupId"].asString();
if(!allImagesNodeFacesFacesItem["FaceQuality"].isNull())
facesObject.faceQuality = std::stof(allImagesNodeFacesFacesItem["FaceQuality"].asString());
if(!valueImagesImagesItemFacesFacesItem["Age"].isNull())
facesObject.age = std::stoi(valueImagesImagesItemFacesFacesItem["Age"].asString());
if(!valueImagesImagesItemFacesFacesItem["GenderConfidence"].isNull())
facesObject.genderConfidence = std::stof(valueImagesImagesItemFacesFacesItem["GenderConfidence"].asString());
if(!valueImagesImagesItemFacesFacesItem["Attractive"].isNull())
facesObject.attractive = std::stof(valueImagesImagesItemFacesFacesItem["Attractive"].asString());
if(!valueImagesImagesItemFacesFacesItem["Gender"].isNull())
facesObject.gender = valueImagesImagesItemFacesFacesItem["Gender"].asString();
if(!valueImagesImagesItemFacesFacesItem["FaceConfidence"].isNull())
facesObject.faceConfidence = std::stof(valueImagesImagesItemFacesFacesItem["FaceConfidence"].asString());
if(!valueImagesImagesItemFacesFacesItem["Emotion"].isNull())
facesObject.emotion = valueImagesImagesItemFacesFacesItem["Emotion"].asString();
if(!valueImagesImagesItemFacesFacesItem["FaceId"].isNull())
facesObject.faceId = valueImagesImagesItemFacesFacesItem["FaceId"].asString();
if(!valueImagesImagesItemFacesFacesItem["EmotionConfidence"].isNull())
facesObject.emotionConfidence = std::stof(valueImagesImagesItemFacesFacesItem["EmotionConfidence"].asString());
if(!valueImagesImagesItemFacesFacesItem["GroupId"].isNull())
facesObject.groupId = valueImagesImagesItemFacesFacesItem["GroupId"].asString();
if(!valueImagesImagesItemFacesFacesItem["FaceQuality"].isNull())
facesObject.faceQuality = std::stof(valueImagesImagesItemFacesFacesItem["FaceQuality"].asString());
auto emotionDetailsNode = value["EmotionDetails"];
if(!emotionDetailsNode["SAD"].isNull())
facesObject.emotionDetails.sAD = std::stof(emotionDetailsNode["SAD"].asString());
@@ -220,28 +220,28 @@ void FindImagesResult::parse(const std::string &payload)
facesObject.faceAttributes.headPose.yaw = std::stof(headPoseNode["Yaw"].asString());
imagesObject.faces.push_back(facesObject);
}
auto allTagsNode = allImagesNode["Tags"]["TagsItem"];
for (auto allImagesNodeTagsTagsItem : allTagsNode)
auto allTagsNode = valueImagesImagesItem["Tags"]["TagsItem"];
for (auto valueImagesImagesItemTagsTagsItem : allTagsNode)
{
ImagesItem::TagsItem tagsObject;
if(!allImagesNodeTagsTagsItem["TagConfidence"].isNull())
tagsObject.tagConfidence = std::stof(allImagesNodeTagsTagsItem["TagConfidence"].asString());
if(!allImagesNodeTagsTagsItem["TagLevel"].isNull())
tagsObject.tagLevel = std::stoi(allImagesNodeTagsTagsItem["TagLevel"].asString());
if(!allImagesNodeTagsTagsItem["TagName"].isNull())
tagsObject.tagName = allImagesNodeTagsTagsItem["TagName"].asString();
if(!allImagesNodeTagsTagsItem["ParentTagName"].isNull())
tagsObject.parentTagName = allImagesNodeTagsTagsItem["ParentTagName"].asString();
if(!valueImagesImagesItemTagsTagsItem["TagConfidence"].isNull())
tagsObject.tagConfidence = std::stof(valueImagesImagesItemTagsTagsItem["TagConfidence"].asString());
if(!valueImagesImagesItemTagsTagsItem["TagLevel"].isNull())
tagsObject.tagLevel = std::stoi(valueImagesImagesItemTagsTagsItem["TagLevel"].asString());
if(!valueImagesImagesItemTagsTagsItem["TagName"].isNull())
tagsObject.tagName = valueImagesImagesItemTagsTagsItem["TagName"].asString();
if(!valueImagesImagesItemTagsTagsItem["ParentTagName"].isNull())
tagsObject.parentTagName = valueImagesImagesItemTagsTagsItem["ParentTagName"].asString();
imagesObject.tags.push_back(tagsObject);
}
auto allOCRNode = allImagesNode["OCR"]["OCRItem"];
for (auto allImagesNodeOCROCRItem : allOCRNode)
auto allOCRNode = valueImagesImagesItem["OCR"]["OCRItem"];
for (auto valueImagesImagesItemOCROCRItem : allOCRNode)
{
ImagesItem::OCRItem oCRObject;
if(!allImagesNodeOCROCRItem["OCRContents"].isNull())
oCRObject.oCRContents = allImagesNodeOCROCRItem["OCRContents"].asString();
if(!allImagesNodeOCROCRItem["OCRConfidence"].isNull())
oCRObject.oCRConfidence = std::stof(allImagesNodeOCROCRItem["OCRConfidence"].asString());
if(!valueImagesImagesItemOCROCRItem["OCRContents"].isNull())
oCRObject.oCRContents = valueImagesImagesItemOCROCRItem["OCRContents"].asString();
if(!valueImagesImagesItemOCROCRItem["OCRConfidence"].isNull())
oCRObject.oCRConfidence = std::stof(valueImagesImagesItemOCROCRItem["OCRConfidence"].asString());
auto oCRBoundaryNode = value["OCRBoundary"];
if(!oCRBoundaryNode["Left"].isNull())
oCRObject.oCRBoundary.left = std::stoi(oCRBoundaryNode["Left"].asString());
@@ -253,18 +253,18 @@ void FindImagesResult::parse(const std::string &payload)
oCRObject.oCRBoundary.height = std::stoi(oCRBoundaryNode["Height"].asString());
imagesObject.oCR.push_back(oCRObject);
}
auto allCelebrityNode = allImagesNode["Celebrity"]["CelebrityItem"];
for (auto allImagesNodeCelebrityCelebrityItem : allCelebrityNode)
auto allCelebrityNode = valueImagesImagesItem["Celebrity"]["CelebrityItem"];
for (auto valueImagesImagesItemCelebrityCelebrityItem : allCelebrityNode)
{
ImagesItem::CelebrityItem celebrityObject;
if(!allImagesNodeCelebrityCelebrityItem["CelebrityName"].isNull())
celebrityObject.celebrityName = allImagesNodeCelebrityCelebrityItem["CelebrityName"].asString();
if(!allImagesNodeCelebrityCelebrityItem["CelebrityGender"].isNull())
celebrityObject.celebrityGender = allImagesNodeCelebrityCelebrityItem["CelebrityGender"].asString();
if(!allImagesNodeCelebrityCelebrityItem["CelebrityConfidence"].isNull())
celebrityObject.celebrityConfidence = std::stof(allImagesNodeCelebrityCelebrityItem["CelebrityConfidence"].asString());
if(!allImagesNodeCelebrityCelebrityItem["CelebrityLibraryName"].isNull())
celebrityObject.celebrityLibraryName = allImagesNodeCelebrityCelebrityItem["CelebrityLibraryName"].asString();
if(!valueImagesImagesItemCelebrityCelebrityItem["CelebrityName"].isNull())
celebrityObject.celebrityName = valueImagesImagesItemCelebrityCelebrityItem["CelebrityName"].asString();
if(!valueImagesImagesItemCelebrityCelebrityItem["CelebrityGender"].isNull())
celebrityObject.celebrityGender = valueImagesImagesItemCelebrityCelebrityItem["CelebrityGender"].asString();
if(!valueImagesImagesItemCelebrityCelebrityItem["CelebrityConfidence"].isNull())
celebrityObject.celebrityConfidence = std::stof(valueImagesImagesItemCelebrityCelebrityItem["CelebrityConfidence"].asString());
if(!valueImagesImagesItemCelebrityCelebrityItem["CelebrityLibraryName"].isNull())
celebrityObject.celebrityLibraryName = valueImagesImagesItemCelebrityCelebrityItem["CelebrityLibraryName"].asString();
auto celebrityBoundaryNode = value["CelebrityBoundary"];
if(!celebrityBoundaryNode["Left"].isNull())
celebrityObject.celebrityBoundary.left = std::stoi(celebrityBoundaryNode["Left"].asString());

View File

@@ -51,18 +51,18 @@ void FindSimilarFacesResult::parse(const std::string &payload)
facesObject.similarity = std::stof(valueFacesFacesItem["Similarity"].asString());
if(!valueFacesFacesItem["ExternalId"].isNull())
facesObject.externalId = valueFacesFacesItem["ExternalId"].asString();
auto allSimilarFacesNode = allFacesNode["SimilarFaces"]["SimilarFacesItem"];
for (auto allFacesNodeSimilarFacesSimilarFacesItem : allSimilarFacesNode)
auto allSimilarFacesNode = valueFacesFacesItem["SimilarFaces"]["SimilarFacesItem"];
for (auto valueFacesFacesItemSimilarFacesSimilarFacesItem : allSimilarFacesNode)
{
FacesItem::SimilarFacesItem similarFacesObject;
if(!allFacesNodeSimilarFacesSimilarFacesItem["FaceId"].isNull())
similarFacesObject.faceId = allFacesNodeSimilarFacesSimilarFacesItem["FaceId"].asString();
if(!allFacesNodeSimilarFacesSimilarFacesItem["ImageUri"].isNull())
similarFacesObject.imageUri = allFacesNodeSimilarFacesSimilarFacesItem["ImageUri"].asString();
if(!allFacesNodeSimilarFacesSimilarFacesItem["Similarity"].isNull())
similarFacesObject.similarity = std::stof(allFacesNodeSimilarFacesSimilarFacesItem["Similarity"].asString());
if(!allFacesNodeSimilarFacesSimilarFacesItem["ExternalId"].isNull())
similarFacesObject.externalId = allFacesNodeSimilarFacesSimilarFacesItem["ExternalId"].asString();
if(!valueFacesFacesItemSimilarFacesSimilarFacesItem["FaceId"].isNull())
similarFacesObject.faceId = valueFacesFacesItemSimilarFacesSimilarFacesItem["FaceId"].asString();
if(!valueFacesFacesItemSimilarFacesSimilarFacesItem["ImageUri"].isNull())
similarFacesObject.imageUri = valueFacesFacesItemSimilarFacesSimilarFacesItem["ImageUri"].asString();
if(!valueFacesFacesItemSimilarFacesSimilarFacesItem["Similarity"].isNull())
similarFacesObject.similarity = std::stof(valueFacesFacesItemSimilarFacesSimilarFacesItem["Similarity"].asString());
if(!valueFacesFacesItemSimilarFacesSimilarFacesItem["ExternalId"].isNull())
similarFacesObject.externalId = valueFacesFacesItemSimilarFacesSimilarFacesItem["ExternalId"].asString();
auto faceAttributes1Node = value["FaceAttributes"];
auto faceBoundaryNode = faceAttributes1Node["FaceBoundary"];
if(!faceBoundaryNode["Left"].isNull())

View File

@@ -74,6 +74,23 @@ void GetMediaMetaResult::parse(const std::string &payload)
mediaMeta_.mediaFormat.address.district = addressNode["District"].asString();
if(!addressNode["Township"].isNull())
mediaMeta_.mediaFormat.address.township = addressNode["Township"].asString();
auto tagNode = mediaFormatNode["Tag"];
if(!tagNode["Language"].isNull())
mediaMeta_.mediaFormat.tag.language = tagNode["Language"].asString();
if(!tagNode["CreationTime"].isNull())
mediaMeta_.mediaFormat.tag.creationTime = tagNode["CreationTime"].asString();
if(!tagNode["Album"].isNull())
mediaMeta_.mediaFormat.tag.album = tagNode["Album"].asString();
if(!tagNode["AlbumArtist"].isNull())
mediaMeta_.mediaFormat.tag.albumArtist = tagNode["AlbumArtist"].asString();
if(!tagNode["Artist"].isNull())
mediaMeta_.mediaFormat.tag.artist = tagNode["Artist"].asString();
if(!tagNode["Composer"].isNull())
mediaMeta_.mediaFormat.tag.composer = tagNode["Composer"].asString();
if(!tagNode["Title"].isNull())
mediaMeta_.mediaFormat.tag.title = tagNode["Title"].asString();
if(!tagNode["Performer"].isNull())
mediaMeta_.mediaFormat.tag.performer = tagNode["Performer"].asString();
auto mediaStreamsNode = mediaMetaNode["MediaStreams"];
auto allVideoStreamsNode = mediaStreamsNode["VideoStreams"]["VideoStream"];
for (auto mediaStreamsNodeVideoStreamsVideoStream : allVideoStreamsNode)

View File

@@ -127,14 +127,14 @@ void ListImagesResult::parse(const std::string &payload)
imagesObject.croppingSuggestionFailReason = valueImagesImagesItem["CroppingSuggestionFailReason"].asString();
if(!valueImagesImagesItem["CroppingSuggestionModifyTime"].isNull())
imagesObject.croppingSuggestionModifyTime = valueImagesImagesItem["CroppingSuggestionModifyTime"].asString();
auto allCroppingSuggestionNode = allImagesNode["CroppingSuggestion"]["CroppingSuggestionItem"];
for (auto allImagesNodeCroppingSuggestionCroppingSuggestionItem : allCroppingSuggestionNode)
auto allCroppingSuggestionNode = valueImagesImagesItem["CroppingSuggestion"]["CroppingSuggestionItem"];
for (auto valueImagesImagesItemCroppingSuggestionCroppingSuggestionItem : allCroppingSuggestionNode)
{
ImagesItem::CroppingSuggestionItem croppingSuggestionObject;
if(!allImagesNodeCroppingSuggestionCroppingSuggestionItem["AspectRatio"].isNull())
croppingSuggestionObject.aspectRatio = allImagesNodeCroppingSuggestionCroppingSuggestionItem["AspectRatio"].asString();
if(!allImagesNodeCroppingSuggestionCroppingSuggestionItem["Score"].isNull())
croppingSuggestionObject.score = std::stof(allImagesNodeCroppingSuggestionCroppingSuggestionItem["Score"].asString());
if(!valueImagesImagesItemCroppingSuggestionCroppingSuggestionItem["AspectRatio"].isNull())
croppingSuggestionObject.aspectRatio = valueImagesImagesItemCroppingSuggestionCroppingSuggestionItem["AspectRatio"].asString();
if(!valueImagesImagesItemCroppingSuggestionCroppingSuggestionItem["Score"].isNull())
croppingSuggestionObject.score = std::stof(valueImagesImagesItemCroppingSuggestionCroppingSuggestionItem["Score"].asString());
auto croppingBoundaryNode = value["CroppingBoundary"];
if(!croppingBoundaryNode["Width"].isNull())
croppingSuggestionObject.croppingBoundary.width = std::stoi(croppingBoundaryNode["Width"].asString());
@@ -146,30 +146,30 @@ void ListImagesResult::parse(const std::string &payload)
croppingSuggestionObject.croppingBoundary.top = std::stoi(croppingBoundaryNode["Top"].asString());
imagesObject.croppingSuggestion.push_back(croppingSuggestionObject);
}
auto allFacesNode = allImagesNode["Faces"]["FacesItem"];
for (auto allImagesNodeFacesFacesItem : allFacesNode)
auto allFacesNode = valueImagesImagesItem["Faces"]["FacesItem"];
for (auto valueImagesImagesItemFacesFacesItem : allFacesNode)
{
ImagesItem::FacesItem facesObject;
if(!allImagesNodeFacesFacesItem["Age"].isNull())
facesObject.age = std::stoi(allImagesNodeFacesFacesItem["Age"].asString());
if(!allImagesNodeFacesFacesItem["GenderConfidence"].isNull())
facesObject.genderConfidence = std::stof(allImagesNodeFacesFacesItem["GenderConfidence"].asString());
if(!allImagesNodeFacesFacesItem["Attractive"].isNull())
facesObject.attractive = std::stof(allImagesNodeFacesFacesItem["Attractive"].asString());
if(!allImagesNodeFacesFacesItem["Gender"].isNull())
facesObject.gender = allImagesNodeFacesFacesItem["Gender"].asString();
if(!allImagesNodeFacesFacesItem["FaceConfidence"].isNull())
facesObject.faceConfidence = std::stof(allImagesNodeFacesFacesItem["FaceConfidence"].asString());
if(!allImagesNodeFacesFacesItem["Emotion"].isNull())
facesObject.emotion = allImagesNodeFacesFacesItem["Emotion"].asString();
if(!allImagesNodeFacesFacesItem["FaceId"].isNull())
facesObject.faceId = allImagesNodeFacesFacesItem["FaceId"].asString();
if(!allImagesNodeFacesFacesItem["EmotionConfidence"].isNull())
facesObject.emotionConfidence = std::stof(allImagesNodeFacesFacesItem["EmotionConfidence"].asString());
if(!allImagesNodeFacesFacesItem["GroupId"].isNull())
facesObject.groupId = allImagesNodeFacesFacesItem["GroupId"].asString();
if(!allImagesNodeFacesFacesItem["FaceQuality"].isNull())
facesObject.faceQuality = std::stof(allImagesNodeFacesFacesItem["FaceQuality"].asString());
if(!valueImagesImagesItemFacesFacesItem["Age"].isNull())
facesObject.age = std::stoi(valueImagesImagesItemFacesFacesItem["Age"].asString());
if(!valueImagesImagesItemFacesFacesItem["GenderConfidence"].isNull())
facesObject.genderConfidence = std::stof(valueImagesImagesItemFacesFacesItem["GenderConfidence"].asString());
if(!valueImagesImagesItemFacesFacesItem["Attractive"].isNull())
facesObject.attractive = std::stof(valueImagesImagesItemFacesFacesItem["Attractive"].asString());
if(!valueImagesImagesItemFacesFacesItem["Gender"].isNull())
facesObject.gender = valueImagesImagesItemFacesFacesItem["Gender"].asString();
if(!valueImagesImagesItemFacesFacesItem["FaceConfidence"].isNull())
facesObject.faceConfidence = std::stof(valueImagesImagesItemFacesFacesItem["FaceConfidence"].asString());
if(!valueImagesImagesItemFacesFacesItem["Emotion"].isNull())
facesObject.emotion = valueImagesImagesItemFacesFacesItem["Emotion"].asString();
if(!valueImagesImagesItemFacesFacesItem["FaceId"].isNull())
facesObject.faceId = valueImagesImagesItemFacesFacesItem["FaceId"].asString();
if(!valueImagesImagesItemFacesFacesItem["EmotionConfidence"].isNull())
facesObject.emotionConfidence = std::stof(valueImagesImagesItemFacesFacesItem["EmotionConfidence"].asString());
if(!valueImagesImagesItemFacesFacesItem["GroupId"].isNull())
facesObject.groupId = valueImagesImagesItemFacesFacesItem["GroupId"].asString();
if(!valueImagesImagesItemFacesFacesItem["FaceQuality"].isNull())
facesObject.faceQuality = std::stof(valueImagesImagesItemFacesFacesItem["FaceQuality"].asString());
auto emotionDetailsNode = value["EmotionDetails"];
if(!emotionDetailsNode["SAD"].isNull())
facesObject.emotionDetails.sAD = std::stof(emotionDetailsNode["SAD"].asString());
@@ -220,28 +220,28 @@ void ListImagesResult::parse(const std::string &payload)
facesObject.faceAttributes.headPose.yaw = std::stof(headPoseNode["Yaw"].asString());
imagesObject.faces.push_back(facesObject);
}
auto allTagsNode = allImagesNode["Tags"]["TagsItem"];
for (auto allImagesNodeTagsTagsItem : allTagsNode)
auto allTagsNode = valueImagesImagesItem["Tags"]["TagsItem"];
for (auto valueImagesImagesItemTagsTagsItem : allTagsNode)
{
ImagesItem::TagsItem tagsObject;
if(!allImagesNodeTagsTagsItem["TagConfidence"].isNull())
tagsObject.tagConfidence = std::stof(allImagesNodeTagsTagsItem["TagConfidence"].asString());
if(!allImagesNodeTagsTagsItem["TagLevel"].isNull())
tagsObject.tagLevel = std::stoi(allImagesNodeTagsTagsItem["TagLevel"].asString());
if(!allImagesNodeTagsTagsItem["TagName"].isNull())
tagsObject.tagName = allImagesNodeTagsTagsItem["TagName"].asString();
if(!allImagesNodeTagsTagsItem["ParentTagName"].isNull())
tagsObject.parentTagName = allImagesNodeTagsTagsItem["ParentTagName"].asString();
if(!valueImagesImagesItemTagsTagsItem["TagConfidence"].isNull())
tagsObject.tagConfidence = std::stof(valueImagesImagesItemTagsTagsItem["TagConfidence"].asString());
if(!valueImagesImagesItemTagsTagsItem["TagLevel"].isNull())
tagsObject.tagLevel = std::stoi(valueImagesImagesItemTagsTagsItem["TagLevel"].asString());
if(!valueImagesImagesItemTagsTagsItem["TagName"].isNull())
tagsObject.tagName = valueImagesImagesItemTagsTagsItem["TagName"].asString();
if(!valueImagesImagesItemTagsTagsItem["ParentTagName"].isNull())
tagsObject.parentTagName = valueImagesImagesItemTagsTagsItem["ParentTagName"].asString();
imagesObject.tags.push_back(tagsObject);
}
auto allOCRNode = allImagesNode["OCR"]["OCRItem"];
for (auto allImagesNodeOCROCRItem : allOCRNode)
auto allOCRNode = valueImagesImagesItem["OCR"]["OCRItem"];
for (auto valueImagesImagesItemOCROCRItem : allOCRNode)
{
ImagesItem::OCRItem oCRObject;
if(!allImagesNodeOCROCRItem["OCRContents"].isNull())
oCRObject.oCRContents = allImagesNodeOCROCRItem["OCRContents"].asString();
if(!allImagesNodeOCROCRItem["OCRConfidence"].isNull())
oCRObject.oCRConfidence = std::stof(allImagesNodeOCROCRItem["OCRConfidence"].asString());
if(!valueImagesImagesItemOCROCRItem["OCRContents"].isNull())
oCRObject.oCRContents = valueImagesImagesItemOCROCRItem["OCRContents"].asString();
if(!valueImagesImagesItemOCROCRItem["OCRConfidence"].isNull())
oCRObject.oCRConfidence = std::stof(valueImagesImagesItemOCROCRItem["OCRConfidence"].asString());
auto oCRBoundaryNode = value["OCRBoundary"];
if(!oCRBoundaryNode["Left"].isNull())
oCRObject.oCRBoundary.left = std::stoi(oCRBoundaryNode["Left"].asString());
@@ -253,18 +253,18 @@ void ListImagesResult::parse(const std::string &payload)
oCRObject.oCRBoundary.height = std::stoi(oCRBoundaryNode["Height"].asString());
imagesObject.oCR.push_back(oCRObject);
}
auto allCelebrityNode = allImagesNode["Celebrity"]["CelebrityItem"];
for (auto allImagesNodeCelebrityCelebrityItem : allCelebrityNode)
auto allCelebrityNode = valueImagesImagesItem["Celebrity"]["CelebrityItem"];
for (auto valueImagesImagesItemCelebrityCelebrityItem : allCelebrityNode)
{
ImagesItem::CelebrityItem celebrityObject;
if(!allImagesNodeCelebrityCelebrityItem["CelebrityName"].isNull())
celebrityObject.celebrityName = allImagesNodeCelebrityCelebrityItem["CelebrityName"].asString();
if(!allImagesNodeCelebrityCelebrityItem["CelebrityGender"].isNull())
celebrityObject.celebrityGender = allImagesNodeCelebrityCelebrityItem["CelebrityGender"].asString();
if(!allImagesNodeCelebrityCelebrityItem["CelebrityConfidence"].isNull())
celebrityObject.celebrityConfidence = std::stof(allImagesNodeCelebrityCelebrityItem["CelebrityConfidence"].asString());
if(!allImagesNodeCelebrityCelebrityItem["CelebrityLibraryName"].isNull())
celebrityObject.celebrityLibraryName = allImagesNodeCelebrityCelebrityItem["CelebrityLibraryName"].asString();
if(!valueImagesImagesItemCelebrityCelebrityItem["CelebrityName"].isNull())
celebrityObject.celebrityName = valueImagesImagesItemCelebrityCelebrityItem["CelebrityName"].asString();
if(!valueImagesImagesItemCelebrityCelebrityItem["CelebrityGender"].isNull())
celebrityObject.celebrityGender = valueImagesImagesItemCelebrityCelebrityItem["CelebrityGender"].asString();
if(!valueImagesImagesItemCelebrityCelebrityItem["CelebrityConfidence"].isNull())
celebrityObject.celebrityConfidence = std::stof(valueImagesImagesItemCelebrityCelebrityItem["CelebrityConfidence"].asString());
if(!valueImagesImagesItemCelebrityCelebrityItem["CelebrityLibraryName"].isNull())
celebrityObject.celebrityLibraryName = valueImagesImagesItemCelebrityCelebrityItem["CelebrityLibraryName"].asString();
auto celebrityBoundaryNode = value["CelebrityBoundary"];
if(!celebrityBoundaryNode["Left"].isNull())
celebrityObject.celebrityBoundary.left = std::stoi(celebrityBoundaryNode["Left"].asString());

View File

@@ -85,30 +85,30 @@ void ListVideoAudiosResult::parse(const std::string &payload)
audiosObject.remarksD = valueAudiosAudiosItem["RemarksD"].asString();
if(!valueAudiosAudiosItem["ExternalId"].isNull())
audiosObject.externalId = valueAudiosAudiosItem["ExternalId"].asString();
auto allAudioTextsNode = allAudiosNode["AudioTexts"]["AudioTextsItem"];
for (auto allAudiosNodeAudioTextsAudioTextsItem : allAudioTextsNode)
auto allAudioTextsNode = valueAudiosAudiosItem["AudioTexts"]["AudioTextsItem"];
for (auto valueAudiosAudiosItemAudioTextsAudioTextsItem : allAudioTextsNode)
{
AudiosItem::AudioTextsItem audioTextsObject;
if(!allAudiosNodeAudioTextsAudioTextsItem["Text"].isNull())
audioTextsObject.text = allAudiosNodeAudioTextsAudioTextsItem["Text"].asString();
if(!allAudiosNodeAudioTextsAudioTextsItem["BeginTime"].isNull())
audioTextsObject.beginTime = std::stof(allAudiosNodeAudioTextsAudioTextsItem["BeginTime"].asString());
if(!allAudiosNodeAudioTextsAudioTextsItem["EndTime"].isNull())
audioTextsObject.endTime = std::stof(allAudiosNodeAudioTextsAudioTextsItem["EndTime"].asString());
if(!allAudiosNodeAudioTextsAudioTextsItem["SilenceDuration"].isNull())
audioTextsObject.silenceDuration = std::stof(allAudiosNodeAudioTextsAudioTextsItem["SilenceDuration"].asString());
if(!allAudiosNodeAudioTextsAudioTextsItem["EmotionValue"].isNull())
audioTextsObject.emotionValue = std::stof(allAudiosNodeAudioTextsAudioTextsItem["EmotionValue"].asString());
if(!allAudiosNodeAudioTextsAudioTextsItem["ChannelId"].isNull())
audioTextsObject.channelId = std::stoi(allAudiosNodeAudioTextsAudioTextsItem["ChannelId"].asString());
if(!allAudiosNodeAudioTextsAudioTextsItem["SpeechRate"].isNull())
audioTextsObject.speechRate = std::stoi(allAudiosNodeAudioTextsAudioTextsItem["SpeechRate"].asString());
if(!allAudiosNodeAudioTextsAudioTextsItem["Confidence"].isNull())
audioTextsObject.confidence = std::stof(allAudiosNodeAudioTextsAudioTextsItem["Confidence"].asString());
if(!allAudiosNodeAudioTextsAudioTextsItem["Person"].isNull())
audioTextsObject.person = allAudiosNodeAudioTextsAudioTextsItem["Person"].asString();
if(!allAudiosNodeAudioTextsAudioTextsItem["Library"].isNull())
audioTextsObject.library = allAudiosNodeAudioTextsAudioTextsItem["Library"].asString();
if(!valueAudiosAudiosItemAudioTextsAudioTextsItem["Text"].isNull())
audioTextsObject.text = valueAudiosAudiosItemAudioTextsAudioTextsItem["Text"].asString();
if(!valueAudiosAudiosItemAudioTextsAudioTextsItem["BeginTime"].isNull())
audioTextsObject.beginTime = std::stof(valueAudiosAudiosItemAudioTextsAudioTextsItem["BeginTime"].asString());
if(!valueAudiosAudiosItemAudioTextsAudioTextsItem["EndTime"].isNull())
audioTextsObject.endTime = std::stof(valueAudiosAudiosItemAudioTextsAudioTextsItem["EndTime"].asString());
if(!valueAudiosAudiosItemAudioTextsAudioTextsItem["SilenceDuration"].isNull())
audioTextsObject.silenceDuration = std::stof(valueAudiosAudiosItemAudioTextsAudioTextsItem["SilenceDuration"].asString());
if(!valueAudiosAudiosItemAudioTextsAudioTextsItem["EmotionValue"].isNull())
audioTextsObject.emotionValue = std::stof(valueAudiosAudiosItemAudioTextsAudioTextsItem["EmotionValue"].asString());
if(!valueAudiosAudiosItemAudioTextsAudioTextsItem["ChannelId"].isNull())
audioTextsObject.channelId = std::stoi(valueAudiosAudiosItemAudioTextsAudioTextsItem["ChannelId"].asString());
if(!valueAudiosAudiosItemAudioTextsAudioTextsItem["SpeechRate"].isNull())
audioTextsObject.speechRate = std::stoi(valueAudiosAudiosItemAudioTextsAudioTextsItem["SpeechRate"].asString());
if(!valueAudiosAudiosItemAudioTextsAudioTextsItem["Confidence"].isNull())
audioTextsObject.confidence = std::stof(valueAudiosAudiosItemAudioTextsAudioTextsItem["Confidence"].asString());
if(!valueAudiosAudiosItemAudioTextsAudioTextsItem["Person"].isNull())
audioTextsObject.person = valueAudiosAudiosItemAudioTextsAudioTextsItem["Person"].asString();
if(!valueAudiosAudiosItemAudioTextsAudioTextsItem["Library"].isNull())
audioTextsObject.library = valueAudiosAudiosItemAudioTextsAudioTextsItem["Library"].asString();
audiosObject.audioTexts.push_back(audioTextsObject);
}
audios_.push_back(audiosObject);

View File

@@ -105,30 +105,30 @@ void ListVideoFramesResult::parse(const std::string &payload)
framesObject.remarksD = valueFramesFramesItem["RemarksD"].asString();
if(!valueFramesFramesItem["ExternalId"].isNull())
framesObject.externalId = valueFramesFramesItem["ExternalId"].asString();
auto allFacesNode = allFramesNode["Faces"]["FacesItem"];
for (auto allFramesNodeFacesFacesItem : allFacesNode)
auto allFacesNode = valueFramesFramesItem["Faces"]["FacesItem"];
for (auto valueFramesFramesItemFacesFacesItem : allFacesNode)
{
FramesItem::FacesItem facesObject;
if(!allFramesNodeFacesFacesItem["Age"].isNull())
facesObject.age = std::stoi(allFramesNodeFacesFacesItem["Age"].asString());
if(!allFramesNodeFacesFacesItem["GenderConfidence"].isNull())
facesObject.genderConfidence = std::stof(allFramesNodeFacesFacesItem["GenderConfidence"].asString());
if(!allFramesNodeFacesFacesItem["Attractive"].isNull())
facesObject.attractive = std::stof(allFramesNodeFacesFacesItem["Attractive"].asString());
if(!allFramesNodeFacesFacesItem["Gender"].isNull())
facesObject.gender = allFramesNodeFacesFacesItem["Gender"].asString();
if(!allFramesNodeFacesFacesItem["FaceConfidence"].isNull())
facesObject.faceConfidence = std::stof(allFramesNodeFacesFacesItem["FaceConfidence"].asString());
if(!allFramesNodeFacesFacesItem["Emotion"].isNull())
facesObject.emotion = allFramesNodeFacesFacesItem["Emotion"].asString();
if(!allFramesNodeFacesFacesItem["FaceId"].isNull())
facesObject.faceId = allFramesNodeFacesFacesItem["FaceId"].asString();
if(!allFramesNodeFacesFacesItem["EmotionConfidence"].isNull())
facesObject.emotionConfidence = std::stof(allFramesNodeFacesFacesItem["EmotionConfidence"].asString());
if(!allFramesNodeFacesFacesItem["GroupId"].isNull())
facesObject.groupId = allFramesNodeFacesFacesItem["GroupId"].asString();
if(!allFramesNodeFacesFacesItem["FaceQuality"].isNull())
facesObject.faceQuality = std::stof(allFramesNodeFacesFacesItem["FaceQuality"].asString());
if(!valueFramesFramesItemFacesFacesItem["Age"].isNull())
facesObject.age = std::stoi(valueFramesFramesItemFacesFacesItem["Age"].asString());
if(!valueFramesFramesItemFacesFacesItem["GenderConfidence"].isNull())
facesObject.genderConfidence = std::stof(valueFramesFramesItemFacesFacesItem["GenderConfidence"].asString());
if(!valueFramesFramesItemFacesFacesItem["Attractive"].isNull())
facesObject.attractive = std::stof(valueFramesFramesItemFacesFacesItem["Attractive"].asString());
if(!valueFramesFramesItemFacesFacesItem["Gender"].isNull())
facesObject.gender = valueFramesFramesItemFacesFacesItem["Gender"].asString();
if(!valueFramesFramesItemFacesFacesItem["FaceConfidence"].isNull())
facesObject.faceConfidence = std::stof(valueFramesFramesItemFacesFacesItem["FaceConfidence"].asString());
if(!valueFramesFramesItemFacesFacesItem["Emotion"].isNull())
facesObject.emotion = valueFramesFramesItemFacesFacesItem["Emotion"].asString();
if(!valueFramesFramesItemFacesFacesItem["FaceId"].isNull())
facesObject.faceId = valueFramesFramesItemFacesFacesItem["FaceId"].asString();
if(!valueFramesFramesItemFacesFacesItem["EmotionConfidence"].isNull())
facesObject.emotionConfidence = std::stof(valueFramesFramesItemFacesFacesItem["EmotionConfidence"].asString());
if(!valueFramesFramesItemFacesFacesItem["GroupId"].isNull())
facesObject.groupId = valueFramesFramesItemFacesFacesItem["GroupId"].asString();
if(!valueFramesFramesItemFacesFacesItem["FaceQuality"].isNull())
facesObject.faceQuality = std::stof(valueFramesFramesItemFacesFacesItem["FaceQuality"].asString());
auto emotionDetailsNode = value["EmotionDetails"];
if(!emotionDetailsNode["SAD"].isNull())
facesObject.emotionDetails.sAD = std::stof(emotionDetailsNode["SAD"].asString());
@@ -179,28 +179,28 @@ void ListVideoFramesResult::parse(const std::string &payload)
facesObject.faceAttributes.headPose.yaw = std::stof(headPoseNode["Yaw"].asString());
framesObject.faces.push_back(facesObject);
}
auto allTagsNode = allFramesNode["Tags"]["TagsItem"];
for (auto allFramesNodeTagsTagsItem : allTagsNode)
auto allTagsNode = valueFramesFramesItem["Tags"]["TagsItem"];
for (auto valueFramesFramesItemTagsTagsItem : allTagsNode)
{
FramesItem::TagsItem tagsObject;
if(!allFramesNodeTagsTagsItem["TagConfidence"].isNull())
tagsObject.tagConfidence = std::stof(allFramesNodeTagsTagsItem["TagConfidence"].asString());
if(!allFramesNodeTagsTagsItem["TagLevel"].isNull())
tagsObject.tagLevel = std::stoi(allFramesNodeTagsTagsItem["TagLevel"].asString());
if(!allFramesNodeTagsTagsItem["TagName"].isNull())
tagsObject.tagName = allFramesNodeTagsTagsItem["TagName"].asString();
if(!allFramesNodeTagsTagsItem["ParentTagName"].isNull())
tagsObject.parentTagName = allFramesNodeTagsTagsItem["ParentTagName"].asString();
if(!valueFramesFramesItemTagsTagsItem["TagConfidence"].isNull())
tagsObject.tagConfidence = std::stof(valueFramesFramesItemTagsTagsItem["TagConfidence"].asString());
if(!valueFramesFramesItemTagsTagsItem["TagLevel"].isNull())
tagsObject.tagLevel = std::stoi(valueFramesFramesItemTagsTagsItem["TagLevel"].asString());
if(!valueFramesFramesItemTagsTagsItem["TagName"].isNull())
tagsObject.tagName = valueFramesFramesItemTagsTagsItem["TagName"].asString();
if(!valueFramesFramesItemTagsTagsItem["ParentTagName"].isNull())
tagsObject.parentTagName = valueFramesFramesItemTagsTagsItem["ParentTagName"].asString();
framesObject.tags.push_back(tagsObject);
}
auto allOCRNode = allFramesNode["OCR"]["OCRItem"];
for (auto allFramesNodeOCROCRItem : allOCRNode)
auto allOCRNode = valueFramesFramesItem["OCR"]["OCRItem"];
for (auto valueFramesFramesItemOCROCRItem : allOCRNode)
{
FramesItem::OCRItem oCRObject;
if(!allFramesNodeOCROCRItem["OCRContents"].isNull())
oCRObject.oCRContents = allFramesNodeOCROCRItem["OCRContents"].asString();
if(!allFramesNodeOCROCRItem["OCRConfidence"].isNull())
oCRObject.oCRConfidence = std::stof(allFramesNodeOCROCRItem["OCRConfidence"].asString());
if(!valueFramesFramesItemOCROCRItem["OCRContents"].isNull())
oCRObject.oCRContents = valueFramesFramesItemOCROCRItem["OCRContents"].asString();
if(!valueFramesFramesItemOCROCRItem["OCRConfidence"].isNull())
oCRObject.oCRConfidence = std::stof(valueFramesFramesItemOCROCRItem["OCRConfidence"].asString());
auto oCRBoundaryNode = value["OCRBoundary"];
if(!oCRBoundaryNode["Left"].isNull())
oCRObject.oCRBoundary.left = std::stoi(oCRBoundaryNode["Left"].asString());
@@ -212,18 +212,18 @@ void ListVideoFramesResult::parse(const std::string &payload)
oCRObject.oCRBoundary.height = std::stoi(oCRBoundaryNode["Height"].asString());
framesObject.oCR.push_back(oCRObject);
}
auto allCelebrityNode = allFramesNode["Celebrity"]["CelebrityItem"];
for (auto allFramesNodeCelebrityCelebrityItem : allCelebrityNode)
auto allCelebrityNode = valueFramesFramesItem["Celebrity"]["CelebrityItem"];
for (auto valueFramesFramesItemCelebrityCelebrityItem : allCelebrityNode)
{
FramesItem::CelebrityItem celebrityObject;
if(!allFramesNodeCelebrityCelebrityItem["CelebrityName"].isNull())
celebrityObject.celebrityName = allFramesNodeCelebrityCelebrityItem["CelebrityName"].asString();
if(!allFramesNodeCelebrityCelebrityItem["CelebrityGender"].isNull())
celebrityObject.celebrityGender = allFramesNodeCelebrityCelebrityItem["CelebrityGender"].asString();
if(!allFramesNodeCelebrityCelebrityItem["CelebrityConfidence"].isNull())
celebrityObject.celebrityConfidence = std::stof(allFramesNodeCelebrityCelebrityItem["CelebrityConfidence"].asString());
if(!allFramesNodeCelebrityCelebrityItem["CelebrityLibraryName"].isNull())
celebrityObject.celebrityLibraryName = allFramesNodeCelebrityCelebrityItem["CelebrityLibraryName"].asString();
if(!valueFramesFramesItemCelebrityCelebrityItem["CelebrityName"].isNull())
celebrityObject.celebrityName = valueFramesFramesItemCelebrityCelebrityItem["CelebrityName"].asString();
if(!valueFramesFramesItemCelebrityCelebrityItem["CelebrityGender"].isNull())
celebrityObject.celebrityGender = valueFramesFramesItemCelebrityCelebrityItem["CelebrityGender"].asString();
if(!valueFramesFramesItemCelebrityCelebrityItem["CelebrityConfidence"].isNull())
celebrityObject.celebrityConfidence = std::stof(valueFramesFramesItemCelebrityCelebrityItem["CelebrityConfidence"].asString());
if(!valueFramesFramesItemCelebrityCelebrityItem["CelebrityLibraryName"].isNull())
celebrityObject.celebrityLibraryName = valueFramesFramesItemCelebrityCelebrityItem["CelebrityLibraryName"].asString();
auto celebrityBoundaryNode = value["CelebrityBoundary"];
if(!celebrityBoundaryNode["Left"].isNull())
celebrityObject.celebrityBoundary.left = std::stoi(celebrityBoundaryNode["Left"].asString());

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