Compare commits

..

2 Commits

Author SHA1 Message Date
sdk-team
ebcf5e990d IMM SDK Auto Released By zhengrui.lj,Version:1.36.25
Signed-off-by: sdk-team <sdk-team@alibabacloud.com>
2019-05-14 14:50:52 +08:00
sdk-team
e1febab02f IMM SDK Auto Released By zhengrui.lj,Version:1.36.24
Signed-off-by: sdk-team <sdk-team@alibabacloud.com>
2019-05-14 14:34:52 +08:00
12 changed files with 685 additions and 1 deletions

View File

@@ -1,3 +1,9 @@
2019-05-14 Version: 1.36.25
1, Support body detect.
2019-05-14 Version: 1.36.24
1, Support body detect.
2019-05-13 Version: 1.36.23
1, Support for creating instances and joining multiple security groups at the same time.

View File

@@ -1 +1 @@
1.36.23
1.36.25

View File

@@ -116,6 +116,8 @@
#include "model/UpdateFaceGroupResult.h"
#include "model/ListTagPhotosRequest.h"
#include "model/ListTagPhotosResult.h"
#include "model/DetectImageBodiesRequest.h"
#include "model/DetectImageBodiesResult.h"
#include "model/DeleteFaceSearchImageByIdRequest.h"
#include "model/DeleteFaceSearchImageByIdResult.h"
#include "model/IndexVideoRequest.h"
@@ -128,6 +130,8 @@
#include "model/GetImageJobResult.h"
#include "model/ListVideoAudiosRequest.h"
#include "model/ListVideoAudiosResult.h"
#include "model/CreateMergeFaceGroupsJobRequest.h"
#include "model/CreateMergeFaceGroupsJobResult.h"
#include "model/DeleteTagByUrlRequest.h"
#include "model/DeleteTagByUrlResult.h"
#include "model/ListTagSetsRequest.h"
@@ -358,6 +362,9 @@ namespace AlibabaCloud
typedef Outcome<Error, Model::ListTagPhotosResult> ListTagPhotosOutcome;
typedef std::future<ListTagPhotosOutcome> ListTagPhotosOutcomeCallable;
typedef std::function<void(const ImmClient*, const Model::ListTagPhotosRequest&, const ListTagPhotosOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ListTagPhotosAsyncHandler;
typedef Outcome<Error, Model::DetectImageBodiesResult> DetectImageBodiesOutcome;
typedef std::future<DetectImageBodiesOutcome> DetectImageBodiesOutcomeCallable;
typedef std::function<void(const ImmClient*, const Model::DetectImageBodiesRequest&, const DetectImageBodiesOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DetectImageBodiesAsyncHandler;
typedef Outcome<Error, Model::DeleteFaceSearchImageByIdResult> DeleteFaceSearchImageByIdOutcome;
typedef std::future<DeleteFaceSearchImageByIdOutcome> DeleteFaceSearchImageByIdOutcomeCallable;
typedef std::function<void(const ImmClient*, const Model::DeleteFaceSearchImageByIdRequest&, const DeleteFaceSearchImageByIdOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DeleteFaceSearchImageByIdAsyncHandler;
@@ -376,6 +383,9 @@ namespace AlibabaCloud
typedef Outcome<Error, Model::ListVideoAudiosResult> ListVideoAudiosOutcome;
typedef std::future<ListVideoAudiosOutcome> ListVideoAudiosOutcomeCallable;
typedef std::function<void(const ImmClient*, const Model::ListVideoAudiosRequest&, const ListVideoAudiosOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ListVideoAudiosAsyncHandler;
typedef Outcome<Error, Model::CreateMergeFaceGroupsJobResult> CreateMergeFaceGroupsJobOutcome;
typedef std::future<CreateMergeFaceGroupsJobOutcome> CreateMergeFaceGroupsJobOutcomeCallable;
typedef std::function<void(const ImmClient*, const Model::CreateMergeFaceGroupsJobRequest&, const CreateMergeFaceGroupsJobOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> CreateMergeFaceGroupsJobAsyncHandler;
typedef Outcome<Error, Model::DeleteTagByUrlResult> DeleteTagByUrlOutcome;
typedef std::future<DeleteTagByUrlOutcome> DeleteTagByUrlOutcomeCallable;
typedef std::function<void(const ImmClient*, const Model::DeleteTagByUrlRequest&, const DeleteTagByUrlOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DeleteTagByUrlAsyncHandler;
@@ -642,6 +652,9 @@ namespace AlibabaCloud
ListTagPhotosOutcome listTagPhotos(const Model::ListTagPhotosRequest &request)const;
void listTagPhotosAsync(const Model::ListTagPhotosRequest& request, const ListTagPhotosAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
ListTagPhotosOutcomeCallable listTagPhotosCallable(const Model::ListTagPhotosRequest& request) const;
DetectImageBodiesOutcome detectImageBodies(const Model::DetectImageBodiesRequest &request)const;
void detectImageBodiesAsync(const Model::DetectImageBodiesRequest& request, const DetectImageBodiesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
DetectImageBodiesOutcomeCallable detectImageBodiesCallable(const Model::DetectImageBodiesRequest& request) const;
DeleteFaceSearchImageByIdOutcome deleteFaceSearchImageById(const Model::DeleteFaceSearchImageByIdRequest &request)const;
void deleteFaceSearchImageByIdAsync(const Model::DeleteFaceSearchImageByIdRequest& request, const DeleteFaceSearchImageByIdAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
DeleteFaceSearchImageByIdOutcomeCallable deleteFaceSearchImageByIdCallable(const Model::DeleteFaceSearchImageByIdRequest& request) const;
@@ -660,6 +673,9 @@ namespace AlibabaCloud
ListVideoAudiosOutcome listVideoAudios(const Model::ListVideoAudiosRequest &request)const;
void listVideoAudiosAsync(const Model::ListVideoAudiosRequest& request, const ListVideoAudiosAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
ListVideoAudiosOutcomeCallable listVideoAudiosCallable(const Model::ListVideoAudiosRequest& request) const;
CreateMergeFaceGroupsJobOutcome createMergeFaceGroupsJob(const Model::CreateMergeFaceGroupsJobRequest &request)const;
void createMergeFaceGroupsJobAsync(const Model::CreateMergeFaceGroupsJobRequest& request, const CreateMergeFaceGroupsJobAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
CreateMergeFaceGroupsJobOutcomeCallable createMergeFaceGroupsJobCallable(const Model::CreateMergeFaceGroupsJobRequest& request) const;
DeleteTagByUrlOutcome deleteTagByUrl(const Model::DeleteTagByUrlRequest &request)const;
void deleteTagByUrlAsync(const Model::DeleteTagByUrlRequest& request, const DeleteTagByUrlAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
DeleteTagByUrlOutcomeCallable deleteTagByUrlCallable(const Model::DeleteTagByUrlRequest& request) const;

View File

@@ -0,0 +1,69 @@
/*
* 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_IMM_MODEL_CREATEMERGEFACEGROUPSJOBREQUEST_H_
#define ALIBABACLOUD_IMM_MODEL_CREATEMERGEFACEGROUPSJOBREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/imm/ImmExport.h>
namespace AlibabaCloud
{
namespace Imm
{
namespace Model
{
class ALIBABACLOUD_IMM_EXPORT CreateMergeFaceGroupsJobRequest : public RpcServiceRequest
{
public:
CreateMergeFaceGroupsJobRequest();
~CreateMergeFaceGroupsJobRequest();
std::string getGroupIdFrom()const;
void setGroupIdFrom(const std::string& groupIdFrom);
std::string getGroupIdTo()const;
void setGroupIdTo(const std::string& groupIdTo);
std::string getNotifyTopicName()const;
void setNotifyTopicName(const std::string& notifyTopicName);
std::string getRegionId()const;
void setRegionId(const std::string& regionId);
std::string getNotifyEndpoint()const;
void setNotifyEndpoint(const std::string& notifyEndpoint);
std::string getProject()const;
void setProject(const std::string& project);
std::string getSetId()const;
void setSetId(const std::string& setId);
std::string getAccessKeyId()const;
void setAccessKeyId(const std::string& accessKeyId);
private:
std::string groupIdFrom_;
std::string groupIdTo_;
std::string notifyTopicName_;
std::string regionId_;
std::string notifyEndpoint_;
std::string project_;
std::string setId_;
std::string accessKeyId_;
};
}
}
}
#endif // !ALIBABACLOUD_IMM_MODEL_CREATEMERGEFACEGROUPSJOBREQUEST_H_

View File

@@ -0,0 +1,59 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ALIBABACLOUD_IMM_MODEL_CREATEMERGEFACEGROUPSJOBRESULT_H_
#define ALIBABACLOUD_IMM_MODEL_CREATEMERGEFACEGROUPSJOBRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/imm/ImmExport.h>
namespace AlibabaCloud
{
namespace Imm
{
namespace Model
{
class ALIBABACLOUD_IMM_EXPORT CreateMergeFaceGroupsJobResult : public ServiceResult
{
public:
CreateMergeFaceGroupsJobResult();
explicit CreateMergeFaceGroupsJobResult(const std::string &payload);
~CreateMergeFaceGroupsJobResult();
std::string getGroupIdFrom()const;
std::string getJobType()const;
std::string getSetId()const;
std::string getGroupIdTo()const;
std::string getJobId()const;
protected:
void parse(const std::string &payload);
private:
std::string groupIdFrom_;
std::string jobType_;
std::string setId_;
std::string groupIdTo_;
std::string jobId_;
};
}
}
}
#endif // !ALIBABACLOUD_IMM_MODEL_CREATEMERGEFACEGROUPSJOBRESULT_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_IMM_MODEL_DETECTIMAGEBODIESREQUEST_H_
#define ALIBABACLOUD_IMM_MODEL_DETECTIMAGEBODIESREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/imm/ImmExport.h>
namespace AlibabaCloud
{
namespace Imm
{
namespace Model
{
class ALIBABACLOUD_IMM_EXPORT DetectImageBodiesRequest : public RpcServiceRequest
{
public:
DetectImageBodiesRequest();
~DetectImageBodiesRequest();
std::string getImageUri()const;
void setImageUri(const std::string& imageUri);
std::string getRegionId()const;
void setRegionId(const std::string& regionId);
std::string getProject()const;
void setProject(const std::string& project);
std::string getAccessKeyId()const;
void setAccessKeyId(const std::string& accessKeyId);
private:
std::string imageUri_;
std::string regionId_;
std::string project_;
std::string accessKeyId_;
};
}
}
}
#endif // !ALIBABACLOUD_IMM_MODEL_DETECTIMAGEBODIESREQUEST_H_

View File

@@ -0,0 +1,65 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ALIBABACLOUD_IMM_MODEL_DETECTIMAGEBODIESRESULT_H_
#define ALIBABACLOUD_IMM_MODEL_DETECTIMAGEBODIESRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/imm/ImmExport.h>
namespace AlibabaCloud
{
namespace Imm
{
namespace Model
{
class ALIBABACLOUD_IMM_EXPORT DetectImageBodiesResult : public ServiceResult
{
public:
struct BodiesItem
{
struct BodyBoundary
{
int left;
int top;
int height;
int width;
};
float bodyConfidence;
BodyBoundary bodyBoundary;
};
DetectImageBodiesResult();
explicit DetectImageBodiesResult(const std::string &payload);
~DetectImageBodiesResult();
std::vector<BodiesItem> getBodies()const;
std::string getImageUri()const;
protected:
void parse(const std::string &payload);
private:
std::vector<BodiesItem> bodies_;
std::string imageUri_;
};
}
}
}
#endif // !ALIBABACLOUD_IMM_MODEL_DETECTIMAGEBODIESRESULT_H_

View File

@@ -1743,6 +1743,42 @@ ImmClient::ListTagPhotosOutcomeCallable ImmClient::listTagPhotosCallable(const L
return task->get_future();
}
ImmClient::DetectImageBodiesOutcome ImmClient::detectImageBodies(const DetectImageBodiesRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return DetectImageBodiesOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return DetectImageBodiesOutcome(DetectImageBodiesResult(outcome.result()));
else
return DetectImageBodiesOutcome(outcome.error());
}
void ImmClient::detectImageBodiesAsync(const DetectImageBodiesRequest& request, const DetectImageBodiesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, detectImageBodies(request), context);
};
asyncExecute(new Runnable(fn));
}
ImmClient::DetectImageBodiesOutcomeCallable ImmClient::detectImageBodiesCallable(const DetectImageBodiesRequest &request) const
{
auto task = std::make_shared<std::packaged_task<DetectImageBodiesOutcome()>>(
[this, request]()
{
return this->detectImageBodies(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
ImmClient::DeleteFaceSearchImageByIdOutcome ImmClient::deleteFaceSearchImageById(const DeleteFaceSearchImageByIdRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -1959,6 +1995,42 @@ ImmClient::ListVideoAudiosOutcomeCallable ImmClient::listVideoAudiosCallable(con
return task->get_future();
}
ImmClient::CreateMergeFaceGroupsJobOutcome ImmClient::createMergeFaceGroupsJob(const CreateMergeFaceGroupsJobRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return CreateMergeFaceGroupsJobOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return CreateMergeFaceGroupsJobOutcome(CreateMergeFaceGroupsJobResult(outcome.result()));
else
return CreateMergeFaceGroupsJobOutcome(outcome.error());
}
void ImmClient::createMergeFaceGroupsJobAsync(const CreateMergeFaceGroupsJobRequest& request, const CreateMergeFaceGroupsJobAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, createMergeFaceGroupsJob(request), context);
};
asyncExecute(new Runnable(fn));
}
ImmClient::CreateMergeFaceGroupsJobOutcomeCallable ImmClient::createMergeFaceGroupsJobCallable(const CreateMergeFaceGroupsJobRequest &request) const
{
auto task = std::make_shared<std::packaged_task<CreateMergeFaceGroupsJobOutcome()>>(
[this, request]()
{
return this->createMergeFaceGroupsJob(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
ImmClient::DeleteTagByUrlOutcome ImmClient::deleteTagByUrl(const DeleteTagByUrlRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();

View File

@@ -0,0 +1,115 @@
/*
* 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/imm/model/CreateMergeFaceGroupsJobRequest.h>
using AlibabaCloud::Imm::Model::CreateMergeFaceGroupsJobRequest;
CreateMergeFaceGroupsJobRequest::CreateMergeFaceGroupsJobRequest() :
RpcServiceRequest("imm", "2017-09-06", "CreateMergeFaceGroupsJob")
{}
CreateMergeFaceGroupsJobRequest::~CreateMergeFaceGroupsJobRequest()
{}
std::string CreateMergeFaceGroupsJobRequest::getGroupIdFrom()const
{
return groupIdFrom_;
}
void CreateMergeFaceGroupsJobRequest::setGroupIdFrom(const std::string& groupIdFrom)
{
groupIdFrom_ = groupIdFrom;
setCoreParameter("GroupIdFrom", groupIdFrom);
}
std::string CreateMergeFaceGroupsJobRequest::getGroupIdTo()const
{
return groupIdTo_;
}
void CreateMergeFaceGroupsJobRequest::setGroupIdTo(const std::string& groupIdTo)
{
groupIdTo_ = groupIdTo;
setCoreParameter("GroupIdTo", groupIdTo);
}
std::string CreateMergeFaceGroupsJobRequest::getNotifyTopicName()const
{
return notifyTopicName_;
}
void CreateMergeFaceGroupsJobRequest::setNotifyTopicName(const std::string& notifyTopicName)
{
notifyTopicName_ = notifyTopicName;
setCoreParameter("NotifyTopicName", notifyTopicName);
}
std::string CreateMergeFaceGroupsJobRequest::getRegionId()const
{
return regionId_;
}
void CreateMergeFaceGroupsJobRequest::setRegionId(const std::string& regionId)
{
regionId_ = regionId;
setCoreParameter("RegionId", regionId);
}
std::string CreateMergeFaceGroupsJobRequest::getNotifyEndpoint()const
{
return notifyEndpoint_;
}
void CreateMergeFaceGroupsJobRequest::setNotifyEndpoint(const std::string& notifyEndpoint)
{
notifyEndpoint_ = notifyEndpoint;
setCoreParameter("NotifyEndpoint", notifyEndpoint);
}
std::string CreateMergeFaceGroupsJobRequest::getProject()const
{
return project_;
}
void CreateMergeFaceGroupsJobRequest::setProject(const std::string& project)
{
project_ = project;
setCoreParameter("Project", project);
}
std::string CreateMergeFaceGroupsJobRequest::getSetId()const
{
return setId_;
}
void CreateMergeFaceGroupsJobRequest::setSetId(const std::string& setId)
{
setId_ = setId;
setCoreParameter("SetId", setId);
}
std::string CreateMergeFaceGroupsJobRequest::getAccessKeyId()const
{
return accessKeyId_;
}
void CreateMergeFaceGroupsJobRequest::setAccessKeyId(const std::string& accessKeyId)
{
accessKeyId_ = accessKeyId;
setCoreParameter("AccessKeyId", accessKeyId);
}

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.
*/
#include <alibabacloud/imm/model/CreateMergeFaceGroupsJobResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Imm;
using namespace AlibabaCloud::Imm::Model;
CreateMergeFaceGroupsJobResult::CreateMergeFaceGroupsJobResult() :
ServiceResult()
{}
CreateMergeFaceGroupsJobResult::CreateMergeFaceGroupsJobResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
CreateMergeFaceGroupsJobResult::~CreateMergeFaceGroupsJobResult()
{}
void CreateMergeFaceGroupsJobResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
if(!value["JobId"].isNull())
jobId_ = value["JobId"].asString();
if(!value["SetId"].isNull())
setId_ = value["SetId"].asString();
if(!value["JobType"].isNull())
jobType_ = value["JobType"].asString();
if(!value["GroupIdTo"].isNull())
groupIdTo_ = value["GroupIdTo"].asString();
if(!value["GroupIdFrom"].isNull())
groupIdFrom_ = value["GroupIdFrom"].asString();
}
std::string CreateMergeFaceGroupsJobResult::getGroupIdFrom()const
{
return groupIdFrom_;
}
std::string CreateMergeFaceGroupsJobResult::getJobType()const
{
return jobType_;
}
std::string CreateMergeFaceGroupsJobResult::getSetId()const
{
return setId_;
}
std::string CreateMergeFaceGroupsJobResult::getGroupIdTo()const
{
return groupIdTo_;
}
std::string CreateMergeFaceGroupsJobResult::getJobId()const
{
return jobId_;
}

View File

@@ -0,0 +1,71 @@
/*
* 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/imm/model/DetectImageBodiesRequest.h>
using AlibabaCloud::Imm::Model::DetectImageBodiesRequest;
DetectImageBodiesRequest::DetectImageBodiesRequest() :
RpcServiceRequest("imm", "2017-09-06", "DetectImageBodies")
{}
DetectImageBodiesRequest::~DetectImageBodiesRequest()
{}
std::string DetectImageBodiesRequest::getImageUri()const
{
return imageUri_;
}
void DetectImageBodiesRequest::setImageUri(const std::string& imageUri)
{
imageUri_ = imageUri;
setCoreParameter("ImageUri", imageUri);
}
std::string DetectImageBodiesRequest::getRegionId()const
{
return regionId_;
}
void DetectImageBodiesRequest::setRegionId(const std::string& regionId)
{
regionId_ = regionId;
setCoreParameter("RegionId", regionId);
}
std::string DetectImageBodiesRequest::getProject()const
{
return project_;
}
void DetectImageBodiesRequest::setProject(const std::string& project)
{
project_ = project;
setCoreParameter("Project", project);
}
std::string DetectImageBodiesRequest::getAccessKeyId()const
{
return accessKeyId_;
}
void DetectImageBodiesRequest::setAccessKeyId(const std::string& accessKeyId)
{
accessKeyId_ = accessKeyId;
setCoreParameter("AccessKeyId", accessKeyId);
}

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/imm/model/DetectImageBodiesResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Imm;
using namespace AlibabaCloud::Imm::Model;
DetectImageBodiesResult::DetectImageBodiesResult() :
ServiceResult()
{}
DetectImageBodiesResult::DetectImageBodiesResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
DetectImageBodiesResult::~DetectImageBodiesResult()
{}
void DetectImageBodiesResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto allBodies = value["Bodies"]["BodiesItem"];
for (auto value : allBodies)
{
BodiesItem bodiesObject;
if(!value["BodyConfidence"].isNull())
bodiesObject.bodyConfidence = std::stof(value["BodyConfidence"].asString());
auto bodyBoundaryNode = value["BodyBoundary"];
if(!bodyBoundaryNode["Left"].isNull())
bodiesObject.bodyBoundary.left = std::stoi(bodyBoundaryNode["Left"].asString());
if(!bodyBoundaryNode["Top"].isNull())
bodiesObject.bodyBoundary.top = std::stoi(bodyBoundaryNode["Top"].asString());
if(!bodyBoundaryNode["Width"].isNull())
bodiesObject.bodyBoundary.width = std::stoi(bodyBoundaryNode["Width"].asString());
if(!bodyBoundaryNode["Height"].isNull())
bodiesObject.bodyBoundary.height = std::stoi(bodyBoundaryNode["Height"].asString());
bodies_.push_back(bodiesObject);
}
if(!value["ImageUri"].isNull())
imageUri_ = value["ImageUri"].asString();
}
std::vector<DetectImageBodiesResult::BodiesItem> DetectImageBodiesResult::getBodies()const
{
return bodies_;
}
std::string DetectImageBodiesResult::getImageUri()const
{
return imageUri_;
}