Compare commits

..

2 Commits

Author SHA1 Message Date
yixiong.jxy
5aaae25e49 CCC SDK Auto Released By yonghong.lyh,Version:1.22.1
Signed-off-by: yixiong.jxy <yixiong.jxy@alibaba-inc.com>
2018-08-14 09:59:40 +08:00
yixiong.jxy
9a2a29f308 LINKFACE SDK Auto Released By jiayao.wjy,Version:1.22.0
Signed-off-by: yixiong.jxy <yixiong.jxy@alibaba-inc.com>
2018-08-13 17:15:41 +08:00
24 changed files with 684 additions and 1 deletions

View File

@@ -1,3 +1,11 @@
2018-08-14 Version: 1.22.1
1, Change parameter name of Dialogue
2018-08-13 Version: 1.22.0
1, New userinfo fields for registerface input parameter.
2, New userinfo fields for updateface input parameter.
3, New userinfo fields for queryface output parameter.
2018-08-13 Version: 1.21.6
1, Add cross domain support.
2, Add parameter SerialNumber to interface RebootSmartAccessGateway.

View File

@@ -1 +1 @@
1.21.6
1.22.1

View File

@@ -141,6 +141,8 @@ set(ccc_public_header_model
include/alibabacloud/ccc/model/ListRolesResult.h
include/alibabacloud/ccc/model/ListConfigRequest.h
include/alibabacloud/ccc/model/ListConfigResult.h
include/alibabacloud/ccc/model/LaunchShortMessageAppraiseRequest.h
include/alibabacloud/ccc/model/LaunchShortMessageAppraiseResult.h
include/alibabacloud/ccc/model/ModifyPhoneNumberRequest.h
include/alibabacloud/ccc/model/ModifyPhoneNumberResult.h
include/alibabacloud/ccc/model/ListScenariosRequest.h
@@ -300,6 +302,8 @@ set(ccc_src
src/model/ListRolesResult.cc
src/model/ListConfigRequest.cc
src/model/ListConfigResult.cc
src/model/LaunchShortMessageAppraiseRequest.cc
src/model/LaunchShortMessageAppraiseResult.cc
src/model/ModifyPhoneNumberRequest.cc
src/model/ModifyPhoneNumberResult.cc
src/model/ListScenariosRequest.cc

View File

@@ -142,6 +142,8 @@
#include "model/ListRolesResult.h"
#include "model/ListConfigRequest.h"
#include "model/ListConfigResult.h"
#include "model/LaunchShortMessageAppraiseRequest.h"
#include "model/LaunchShortMessageAppraiseResult.h"
#include "model/ModifyPhoneNumberRequest.h"
#include "model/ModifyPhoneNumberResult.h"
#include "model/ListScenariosRequest.h"
@@ -367,6 +369,9 @@ namespace AlibabaCloud
typedef Outcome<Error, Model::ListConfigResult> ListConfigOutcome;
typedef std::future<ListConfigOutcome> ListConfigOutcomeCallable;
typedef std::function<void(const CCCClient*, const Model::ListConfigRequest&, const ListConfigOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ListConfigAsyncHandler;
typedef Outcome<Error, Model::LaunchShortMessageAppraiseResult> LaunchShortMessageAppraiseOutcome;
typedef std::future<LaunchShortMessageAppraiseOutcome> LaunchShortMessageAppraiseOutcomeCallable;
typedef std::function<void(const CCCClient*, const Model::LaunchShortMessageAppraiseRequest&, const LaunchShortMessageAppraiseOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> LaunchShortMessageAppraiseAsyncHandler;
typedef Outcome<Error, Model::ModifyPhoneNumberResult> ModifyPhoneNumberOutcome;
typedef std::future<ModifyPhoneNumberOutcome> ModifyPhoneNumberOutcomeCallable;
typedef std::function<void(const CCCClient*, const Model::ModifyPhoneNumberRequest&, const ModifyPhoneNumberOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ModifyPhoneNumberAsyncHandler;
@@ -606,6 +611,9 @@ namespace AlibabaCloud
ListConfigOutcome listConfig(const Model::ListConfigRequest &request)const;
void listConfigAsync(const Model::ListConfigRequest& request, const ListConfigAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
ListConfigOutcomeCallable listConfigCallable(const Model::ListConfigRequest& request) const;
LaunchShortMessageAppraiseOutcome launchShortMessageAppraise(const Model::LaunchShortMessageAppraiseRequest &request)const;
void launchShortMessageAppraiseAsync(const Model::LaunchShortMessageAppraiseRequest& request, const LaunchShortMessageAppraiseAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
LaunchShortMessageAppraiseOutcomeCallable launchShortMessageAppraiseCallable(const Model::LaunchShortMessageAppraiseRequest& request) const;
ModifyPhoneNumberOutcome modifyPhoneNumber(const Model::ModifyPhoneNumberRequest &request)const;
void modifyPhoneNumberAsync(const Model::ModifyPhoneNumberRequest& request, const ModifyPhoneNumberAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
ModifyPhoneNumberOutcomeCallable modifyPhoneNumberCallable(const Model::ModifyPhoneNumberRequest& request) const;

View File

@@ -43,6 +43,8 @@ namespace AlibabaCloud
void setInstanceId(const std::string& instanceId);
std::string getCalledNumber()const;
void setCalledNumber(const std::string& calledNumber);
std::string getActionKey()const;
void setActionKey(const std::string& actionKey);
std::string getActionParams()const;
void setActionParams(const std::string& actionParams);
std::string getCallType()const;
@@ -59,6 +61,7 @@ namespace AlibabaCloud
std::string callingNumber_;
std::string instanceId_;
std::string calledNumber_;
std::string actionKey_;
std::string actionParams_;
std::string callType_;
std::string scenarioId_;

View File

@@ -0,0 +1,63 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ALIBABACLOUD_CCC_MODEL_LAUNCHSHORTMESSAGEAPPRAISEREQUEST_H_
#define ALIBABACLOUD_CCC_MODEL_LAUNCHSHORTMESSAGEAPPRAISEREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/ccc/CCCExport.h>
namespace AlibabaCloud
{
namespace CCC
{
namespace Model
{
class ALIBABACLOUD_CCC_EXPORT LaunchShortMessageAppraiseRequest : public RpcServiceRequest
{
public:
LaunchShortMessageAppraiseRequest();
~LaunchShortMessageAppraiseRequest();
std::string getAcid()const;
void setAcid(const std::string& acid);
std::string getInstanceId()const;
void setInstanceId(const std::string& instanceId);
int getContactType()const;
void setContactType(int contactType);
std::string getPhoneNumbers()const;
void setPhoneNumbers(const std::string& phoneNumbers);
std::string getSkillGroupId()const;
void setSkillGroupId(const std::string& skillGroupId);
std::string getAccessKeyId()const;
void setAccessKeyId(const std::string& accessKeyId);
private:
std::string acid_;
std::string instanceId_;
int contactType_;
std::string phoneNumbers_;
std::string skillGroupId_;
std::string accessKeyId_;
};
}
}
}
#endif // !ALIBABACLOUD_CCC_MODEL_LAUNCHSHORTMESSAGEAPPRAISEREQUEST_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_CCC_MODEL_LAUNCHSHORTMESSAGEAPPRAISERESULT_H_
#define ALIBABACLOUD_CCC_MODEL_LAUNCHSHORTMESSAGEAPPRAISERESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/ccc/CCCExport.h>
namespace AlibabaCloud
{
namespace CCC
{
namespace Model
{
class ALIBABACLOUD_CCC_EXPORT LaunchShortMessageAppraiseResult : public ServiceResult
{
public:
LaunchShortMessageAppraiseResult();
explicit LaunchShortMessageAppraiseResult(const std::string &payload);
~LaunchShortMessageAppraiseResult();
std::string getMessage()const;
int getHttpStatusCode()const;
std::string getCode()const;
bool getSuccess()const;
protected:
void parse(const std::string &payload);
private:
std::string message_;
int httpStatusCode_;
std::string code_;
bool success_;
};
}
}
}
#endif // !ALIBABACLOUD_CCC_MODEL_LAUNCHSHORTMESSAGEAPPRAISERESULT_H_

View File

@@ -2211,6 +2211,42 @@ CCCClient::ListConfigOutcomeCallable CCCClient::listConfigCallable(const ListCon
return task->get_future();
}
CCCClient::LaunchShortMessageAppraiseOutcome CCCClient::launchShortMessageAppraise(const LaunchShortMessageAppraiseRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return LaunchShortMessageAppraiseOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return LaunchShortMessageAppraiseOutcome(LaunchShortMessageAppraiseResult(outcome.result()));
else
return LaunchShortMessageAppraiseOutcome(outcome.error());
}
void CCCClient::launchShortMessageAppraiseAsync(const LaunchShortMessageAppraiseRequest& request, const LaunchShortMessageAppraiseAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, launchShortMessageAppraise(request), context);
};
asyncExecute(new Runnable(fn));
}
CCCClient::LaunchShortMessageAppraiseOutcomeCallable CCCClient::launchShortMessageAppraiseCallable(const LaunchShortMessageAppraiseRequest &request) const
{
auto task = std::make_shared<std::packaged_task<LaunchShortMessageAppraiseOutcome()>>(
[this, request]()
{
return this->launchShortMessageAppraise(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
CCCClient::ModifyPhoneNumberOutcome CCCClient::modifyPhoneNumber(const ModifyPhoneNumberRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();

View File

@@ -69,6 +69,17 @@ void DialogueRequest::setCalledNumber(const std::string& calledNumber)
setParameter("CalledNumber", calledNumber);
}
std::string DialogueRequest::getActionKey()const
{
return actionKey_;
}
void DialogueRequest::setActionKey(const std::string& actionKey)
{
actionKey_ = actionKey;
setParameter("ActionKey", actionKey);
}
std::string DialogueRequest::getActionParams()const
{
return actionParams_;

View File

@@ -0,0 +1,93 @@
/*
* 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/ccc/model/LaunchShortMessageAppraiseRequest.h>
using AlibabaCloud::CCC::Model::LaunchShortMessageAppraiseRequest;
LaunchShortMessageAppraiseRequest::LaunchShortMessageAppraiseRequest() :
RpcServiceRequest("ccc", "2017-07-05", "LaunchShortMessageAppraise")
{}
LaunchShortMessageAppraiseRequest::~LaunchShortMessageAppraiseRequest()
{}
std::string LaunchShortMessageAppraiseRequest::getAcid()const
{
return acid_;
}
void LaunchShortMessageAppraiseRequest::setAcid(const std::string& acid)
{
acid_ = acid;
setParameter("Acid", acid);
}
std::string LaunchShortMessageAppraiseRequest::getInstanceId()const
{
return instanceId_;
}
void LaunchShortMessageAppraiseRequest::setInstanceId(const std::string& instanceId)
{
instanceId_ = instanceId;
setParameter("InstanceId", instanceId);
}
int LaunchShortMessageAppraiseRequest::getContactType()const
{
return contactType_;
}
void LaunchShortMessageAppraiseRequest::setContactType(int contactType)
{
contactType_ = contactType;
setParameter("ContactType", std::to_string(contactType));
}
std::string LaunchShortMessageAppraiseRequest::getPhoneNumbers()const
{
return phoneNumbers_;
}
void LaunchShortMessageAppraiseRequest::setPhoneNumbers(const std::string& phoneNumbers)
{
phoneNumbers_ = phoneNumbers;
setParameter("PhoneNumbers", phoneNumbers);
}
std::string LaunchShortMessageAppraiseRequest::getSkillGroupId()const
{
return skillGroupId_;
}
void LaunchShortMessageAppraiseRequest::setSkillGroupId(const std::string& skillGroupId)
{
skillGroupId_ = skillGroupId;
setParameter("SkillGroupId", skillGroupId);
}
std::string LaunchShortMessageAppraiseRequest::getAccessKeyId()const
{
return accessKeyId_;
}
void LaunchShortMessageAppraiseRequest::setAccessKeyId(const std::string& accessKeyId)
{
accessKeyId_ = accessKeyId;
setParameter("AccessKeyId", accessKeyId);
}

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/ccc/model/LaunchShortMessageAppraiseResult.h>
#include <json/json.h>
using namespace AlibabaCloud::CCC;
using namespace AlibabaCloud::CCC::Model;
LaunchShortMessageAppraiseResult::LaunchShortMessageAppraiseResult() :
ServiceResult()
{}
LaunchShortMessageAppraiseResult::LaunchShortMessageAppraiseResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
LaunchShortMessageAppraiseResult::~LaunchShortMessageAppraiseResult()
{}
void LaunchShortMessageAppraiseResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
if(!value["Success"].isNull())
success_ = value["Success"].asString() == "true";
if(!value["Code"].isNull())
code_ = value["Code"].asString();
if(!value["Message"].isNull())
message_ = value["Message"].asString();
if(!value["HttpStatusCode"].isNull())
httpStatusCode_ = std::stoi(value["HttpStatusCode"].asString());
}
std::string LaunchShortMessageAppraiseResult::getMessage()const
{
return message_;
}
int LaunchShortMessageAppraiseResult::getHttpStatusCode()const
{
return httpStatusCode_;
}
std::string LaunchShortMessageAppraiseResult::getCode()const
{
return code_;
}
bool LaunchShortMessageAppraiseResult::getSuccess()const
{
return success_;
}

View File

@@ -41,6 +41,8 @@ set(linkface_public_header_model
include/alibabacloud/linkface/model/QueryGroupUsersResult.h
include/alibabacloud/linkface/model/LinkFaceRequest.h
include/alibabacloud/linkface/model/LinkFaceResult.h
include/alibabacloud/linkface/model/SearchFaceRequest.h
include/alibabacloud/linkface/model/SearchFaceResult.h
include/alibabacloud/linkface/model/QueryAllGroupsRequest.h
include/alibabacloud/linkface/model/QueryAllGroupsResult.h
include/alibabacloud/linkface/model/RegisterFaceRequest.h
@@ -74,6 +76,8 @@ set(linkface_src
src/model/QueryGroupUsersResult.cc
src/model/LinkFaceRequest.cc
src/model/LinkFaceResult.cc
src/model/SearchFaceRequest.cc
src/model/SearchFaceResult.cc
src/model/QueryAllGroupsRequest.cc
src/model/QueryAllGroupsResult.cc
src/model/RegisterFaceRequest.cc

View File

@@ -42,6 +42,8 @@
#include "model/QueryGroupUsersResult.h"
#include "model/LinkFaceRequest.h"
#include "model/LinkFaceResult.h"
#include "model/SearchFaceRequest.h"
#include "model/SearchFaceResult.h"
#include "model/QueryAllGroupsRequest.h"
#include "model/QueryAllGroupsResult.h"
#include "model/RegisterFaceRequest.h"
@@ -91,6 +93,9 @@ namespace AlibabaCloud
typedef Outcome<Error, Model::LinkFaceResult> LinkFaceOutcome;
typedef std::future<LinkFaceOutcome> LinkFaceOutcomeCallable;
typedef std::function<void(const LinkFaceClient*, const Model::LinkFaceRequest&, const LinkFaceOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> LinkFaceAsyncHandler;
typedef Outcome<Error, Model::SearchFaceResult> SearchFaceOutcome;
typedef std::future<SearchFaceOutcome> SearchFaceOutcomeCallable;
typedef std::function<void(const LinkFaceClient*, const Model::SearchFaceRequest&, const SearchFaceOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> SearchFaceAsyncHandler;
typedef Outcome<Error, Model::QueryAllGroupsResult> QueryAllGroupsOutcome;
typedef std::future<QueryAllGroupsOutcome> QueryAllGroupsOutcomeCallable;
typedef std::function<void(const LinkFaceClient*, const Model::QueryAllGroupsRequest&, const QueryAllGroupsOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> QueryAllGroupsAsyncHandler;
@@ -141,6 +146,9 @@ namespace AlibabaCloud
LinkFaceOutcome linkFace(const Model::LinkFaceRequest &request)const;
void linkFaceAsync(const Model::LinkFaceRequest& request, const LinkFaceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
LinkFaceOutcomeCallable linkFaceCallable(const Model::LinkFaceRequest& request) const;
SearchFaceOutcome searchFace(const Model::SearchFaceRequest &request)const;
void searchFaceAsync(const Model::SearchFaceRequest& request, const SearchFaceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
SearchFaceOutcomeCallable searchFaceCallable(const Model::SearchFaceRequest& request) const;
QueryAllGroupsOutcome queryAllGroups(const Model::QueryAllGroupsRequest &request)const;
void queryAllGroupsAsync(const Model::QueryAllGroupsRequest& request, const QueryAllGroupsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
QueryAllGroupsOutcomeCallable queryAllGroupsCallable(const Model::QueryAllGroupsRequest& request) const;

View File

@@ -37,6 +37,7 @@ namespace AlibabaCloud
struct UserFaceMetasItem
{
int index;
std::string userInfo;
std::string clientTag;
std::string faceUrl;
};

View File

@@ -41,11 +41,14 @@ namespace AlibabaCloud
void setGroupId(const std::string& groupId);
std::string getUserId()const;
void setUserId(const std::string& userId);
std::string getUserInfo()const;
void setUserInfo(const std::string& userInfo);
private:
std::string image_;
std::string groupId_;
std::string userId_;
std::string userInfo_;
};
}

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_LINKFACE_MODEL_SEARCHFACEREQUEST_H_
#define ALIBABACLOUD_LINKFACE_MODEL_SEARCHFACEREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/linkface/LinkFaceExport.h>
namespace AlibabaCloud
{
namespace LinkFace
{
namespace Model
{
class ALIBABACLOUD_LINKFACE_EXPORT SearchFaceRequest : public RpcServiceRequest
{
public:
SearchFaceRequest();
~SearchFaceRequest();
std::string getImage()const;
void setImage(const std::string& image);
std::string getGroupId()const;
void setGroupId(const std::string& groupId);
private:
std::string image_;
std::string groupId_;
};
}
}
}
#endif // !ALIBABACLOUD_LINKFACE_MODEL_SEARCHFACEREQUEST_H_

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_LINKFACE_MODEL_SEARCHFACERESULT_H_
#define ALIBABACLOUD_LINKFACE_MODEL_SEARCHFACERESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/linkface/LinkFaceExport.h>
namespace AlibabaCloud
{
namespace LinkFace
{
namespace Model
{
class ALIBABACLOUD_LINKFACE_EXPORT SearchFaceResult : public ServiceResult
{
public:
struct Data
{
struct TopUserItemItem
{
float score;
std::string userId;
};
std::vector<TopUserItemItem> topUserItem;
};
SearchFaceResult();
explicit SearchFaceResult(const std::string &payload);
~SearchFaceResult();
std::string getMessage()const;
Data getData()const;
int getCode()const;
bool getSuccess()const;
protected:
void parse(const std::string &payload);
private:
std::string message_;
Data data_;
int code_;
bool success_;
};
}
}
}
#endif // !ALIBABACLOUD_LINKFACE_MODEL_SEARCHFACERESULT_H_

View File

@@ -39,10 +39,13 @@ namespace AlibabaCloud
void setImage(const std::string& image);
std::string getUserId()const;
void setUserId(const std::string& userId);
std::string getUserInfo()const;
void setUserInfo(const std::string& userInfo);
private:
std::string image_;
std::string userId_;
std::string userInfo_;
};
}

View File

@@ -411,6 +411,42 @@ LinkFaceClient::LinkFaceOutcomeCallable LinkFaceClient::linkFaceCallable(const L
return task->get_future();
}
LinkFaceClient::SearchFaceOutcome LinkFaceClient::searchFace(const SearchFaceRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return SearchFaceOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return SearchFaceOutcome(SearchFaceResult(outcome.result()));
else
return SearchFaceOutcome(outcome.error());
}
void LinkFaceClient::searchFaceAsync(const SearchFaceRequest& request, const SearchFaceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, searchFace(request), context);
};
asyncExecute(new Runnable(fn));
}
LinkFaceClient::SearchFaceOutcomeCallable LinkFaceClient::searchFaceCallable(const SearchFaceRequest &request) const
{
auto task = std::make_shared<std::packaged_task<SearchFaceOutcome()>>(
[this, request]()
{
return this->searchFace(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
LinkFaceClient::QueryAllGroupsOutcome LinkFaceClient::queryAllGroups(const QueryAllGroupsRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();

View File

@@ -51,6 +51,8 @@ void QueryFaceResult::parse(const std::string &payload)
userFaceMetasItemObject.index = std::stoi(value["Index"].asString());
if(!value["FaceUrl"].isNull())
userFaceMetasItemObject.faceUrl = value["FaceUrl"].asString();
if(!value["UserInfo"].isNull())
userFaceMetasItemObject.userInfo = value["UserInfo"].asString();
data_.userFaceMetas.push_back(userFaceMetasItemObject);
}
auto allGroupIds = dataNode["GroupIds"]["GroupIds"];

View File

@@ -58,3 +58,14 @@ void RegisterFaceRequest::setUserId(const std::string& userId)
setParameter("UserId", userId);
}
std::string RegisterFaceRequest::getUserInfo()const
{
return userInfo_;
}
void RegisterFaceRequest::setUserInfo(const std::string& userInfo)
{
userInfo_ = userInfo;
setParameter("UserInfo", userInfo);
}

View File

@@ -0,0 +1,49 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <alibabacloud/linkface/model/SearchFaceRequest.h>
using AlibabaCloud::LinkFace::Model::SearchFaceRequest;
SearchFaceRequest::SearchFaceRequest() :
RpcServiceRequest("linkface", "2018-07-20", "SearchFace")
{}
SearchFaceRequest::~SearchFaceRequest()
{}
std::string SearchFaceRequest::getImage()const
{
return image_;
}
void SearchFaceRequest::setImage(const std::string& image)
{
image_ = image;
setParameter("Image", image);
}
std::string SearchFaceRequest::getGroupId()const
{
return groupId_;
}
void SearchFaceRequest::setGroupId(const std::string& groupId)
{
groupId_ = groupId;
setParameter("GroupId", groupId);
}

View File

@@ -0,0 +1,82 @@
/*
* 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/linkface/model/SearchFaceResult.h>
#include <json/json.h>
using namespace AlibabaCloud::LinkFace;
using namespace AlibabaCloud::LinkFace::Model;
SearchFaceResult::SearchFaceResult() :
ServiceResult()
{}
SearchFaceResult::SearchFaceResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
SearchFaceResult::~SearchFaceResult()
{}
void SearchFaceResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto dataNode = value["Data"];
auto allTopUserItem = value["TopUserItem"]["TopUserItemItem"];
for (auto value : allTopUserItem)
{
Data::TopUserItemItem topUserItemItemObject;
if(!value["UserId"].isNull())
topUserItemItemObject.userId = value["UserId"].asString();
if(!value["Score"].isNull())
topUserItemItemObject.score = std::stof(value["Score"].asString());
data_.topUserItem.push_back(topUserItemItemObject);
}
if(!value["Code"].isNull())
code_ = std::stoi(value["Code"].asString());
if(!value["Message"].isNull())
message_ = value["Message"].asString();
if(!value["Success"].isNull())
success_ = value["Success"].asString() == "true";
}
std::string SearchFaceResult::getMessage()const
{
return message_;
}
SearchFaceResult::Data SearchFaceResult::getData()const
{
return data_;
}
int SearchFaceResult::getCode()const
{
return code_;
}
bool SearchFaceResult::getSuccess()const
{
return success_;
}

View File

@@ -47,3 +47,14 @@ void UpdateFaceRequest::setUserId(const std::string& userId)
setParameter("UserId", userId);
}
std::string UpdateFaceRequest::getUserInfo()const
{
return userInfo_;
}
void UpdateFaceRequest::setUserInfo(const std::string& userInfo)
{
userInfo_ = userInfo;
setParameter("UserInfo", userInfo);
}