Supported Grab Frame IMM.

This commit is contained in:
sdk-team
2019-10-08 16:50:20 +08:00
parent 009add7f30
commit 82ba7e55bb
11 changed files with 347 additions and 1 deletions

View File

@@ -1,3 +1,6 @@
2019-10-08 Version 1.36.146
- Supported Grab Frame IMM.
2019-10-08 Version 1.36.145
- Supported API MassPush for Push Message or Notice.

View File

@@ -1 +1 @@
1.36.145
1.36.146

View File

@@ -33,6 +33,8 @@ set(imm_public_header_model
include/alibabacloud/imm/model/CreateDocIndexTaskResult.h
include/alibabacloud/imm/model/CreateFaceSetRequest.h
include/alibabacloud/imm/model/CreateFaceSetResult.h
include/alibabacloud/imm/model/CreateGrabFrameTaskRequest.h
include/alibabacloud/imm/model/CreateGrabFrameTaskResult.h
include/alibabacloud/imm/model/CreateGroupFacesJobRequest.h
include/alibabacloud/imm/model/CreateGroupFacesJobResult.h
include/alibabacloud/imm/model/CreateMediaComplexTaskRequest.h
@@ -240,6 +242,8 @@ set(imm_src
src/model/CreateDocIndexTaskResult.cc
src/model/CreateFaceSetRequest.cc
src/model/CreateFaceSetResult.cc
src/model/CreateGrabFrameTaskRequest.cc
src/model/CreateGrabFrameTaskResult.cc
src/model/CreateGroupFacesJobRequest.cc
src/model/CreateGroupFacesJobResult.cc
src/model/CreateMediaComplexTaskRequest.cc

View File

@@ -34,6 +34,8 @@
#include "model/CreateDocIndexTaskResult.h"
#include "model/CreateFaceSetRequest.h"
#include "model/CreateFaceSetResult.h"
#include "model/CreateGrabFrameTaskRequest.h"
#include "model/CreateGrabFrameTaskResult.h"
#include "model/CreateGroupFacesJobRequest.h"
#include "model/CreateGroupFacesJobResult.h"
#include "model/CreateMediaComplexTaskRequest.h"
@@ -253,6 +255,9 @@ namespace AlibabaCloud
typedef Outcome<Error, Model::CreateFaceSetResult> CreateFaceSetOutcome;
typedef std::future<CreateFaceSetOutcome> CreateFaceSetOutcomeCallable;
typedef std::function<void(const ImmClient*, const Model::CreateFaceSetRequest&, const CreateFaceSetOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> CreateFaceSetAsyncHandler;
typedef Outcome<Error, Model::CreateGrabFrameTaskResult> CreateGrabFrameTaskOutcome;
typedef std::future<CreateGrabFrameTaskOutcome> CreateGrabFrameTaskOutcomeCallable;
typedef std::function<void(const ImmClient*, const Model::CreateGrabFrameTaskRequest&, const CreateGrabFrameTaskOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> CreateGrabFrameTaskAsyncHandler;
typedef Outcome<Error, Model::CreateGroupFacesJobResult> CreateGroupFacesJobOutcome;
typedef std::future<CreateGroupFacesJobOutcome> CreateGroupFacesJobOutcomeCallable;
typedef std::function<void(const ImmClient*, const Model::CreateGroupFacesJobRequest&, const CreateGroupFacesJobOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> CreateGroupFacesJobAsyncHandler;
@@ -564,6 +569,9 @@ namespace AlibabaCloud
CreateFaceSetOutcome createFaceSet(const Model::CreateFaceSetRequest &request)const;
void createFaceSetAsync(const Model::CreateFaceSetRequest& request, const CreateFaceSetAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
CreateFaceSetOutcomeCallable createFaceSetCallable(const Model::CreateFaceSetRequest& request) const;
CreateGrabFrameTaskOutcome createGrabFrameTask(const Model::CreateGrabFrameTaskRequest &request)const;
void createGrabFrameTaskAsync(const Model::CreateGrabFrameTaskRequest& request, const CreateGrabFrameTaskAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
CreateGrabFrameTaskOutcomeCallable createGrabFrameTaskCallable(const Model::CreateGrabFrameTaskRequest& request) const;
CreateGroupFacesJobOutcome createGroupFacesJob(const Model::CreateGroupFacesJobRequest &request)const;
void createGroupFacesJobAsync(const Model::CreateGroupFacesJobRequest& request, const CreateGroupFacesJobAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
CreateGroupFacesJobOutcomeCallable createGroupFacesJobCallable(const Model::CreateGroupFacesJobRequest& request) const;

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_IMM_MODEL_CREATEGRABFRAMETASKREQUEST_H_
#define ALIBABACLOUD_IMM_MODEL_CREATEGRABFRAMETASKREQUEST_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 CreateGrabFrameTaskRequest : public RpcServiceRequest
{
public:
CreateGrabFrameTaskRequest();
~CreateGrabFrameTaskRequest();
std::string getProject()const;
void setProject(const std::string& project);
std::string getAccessKeyId()const;
void setAccessKeyId(const std::string& accessKeyId);
std::string getNotifyEndpoint()const;
void setNotifyEndpoint(const std::string& notifyEndpoint);
std::string getCustomMessage()const;
void setCustomMessage(const std::string& customMessage);
std::string getNotifyTopicName()const;
void setNotifyTopicName(const std::string& notifyTopicName);
std::string getTargetList()const;
void setTargetList(const std::string& targetList);
std::string getVideoUri()const;
void setVideoUri(const std::string& videoUri);
private:
std::string project_;
std::string accessKeyId_;
std::string notifyEndpoint_;
std::string customMessage_;
std::string notifyTopicName_;
std::string targetList_;
std::string videoUri_;
};
}
}
}
#endif // !ALIBABACLOUD_IMM_MODEL_CREATEGRABFRAMETASKREQUEST_H_

View File

@@ -0,0 +1,53 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ALIBABACLOUD_IMM_MODEL_CREATEGRABFRAMETASKRESULT_H_
#define ALIBABACLOUD_IMM_MODEL_CREATEGRABFRAMETASKRESULT_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 CreateGrabFrameTaskResult : public ServiceResult
{
public:
CreateGrabFrameTaskResult();
explicit CreateGrabFrameTaskResult(const std::string &payload);
~CreateGrabFrameTaskResult();
std::string getTaskId()const;
std::string getTaskType()const;
protected:
void parse(const std::string &payload);
private:
std::string taskId_;
std::string taskType_;
};
}
}
}
#endif // !ALIBABACLOUD_IMM_MODEL_CREATEGRABFRAMETASKRESULT_H_

View File

@@ -41,6 +41,8 @@ namespace AlibabaCloud
void setAccessKeyId(const std::string& accessKeyId);
std::string getNotifyEndpoint()const;
void setNotifyEndpoint(const std::string& notifyEndpoint);
std::string getCustomMessage()const;
void setCustomMessage(const std::string& customMessage);
std::string getNotifyTopicName()const;
void setNotifyTopicName(const std::string& notifyTopicName);
std::string getTargetList()const;
@@ -52,6 +54,7 @@ namespace AlibabaCloud
std::string project_;
std::string accessKeyId_;
std::string notifyEndpoint_;
std::string customMessage_;
std::string notifyTopicName_;
std::string targetList_;
std::string videoUri_;

View File

@@ -267,6 +267,42 @@ ImmClient::CreateFaceSetOutcomeCallable ImmClient::createFaceSetCallable(const C
return task->get_future();
}
ImmClient::CreateGrabFrameTaskOutcome ImmClient::createGrabFrameTask(const CreateGrabFrameTaskRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return CreateGrabFrameTaskOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return CreateGrabFrameTaskOutcome(CreateGrabFrameTaskResult(outcome.result()));
else
return CreateGrabFrameTaskOutcome(outcome.error());
}
void ImmClient::createGrabFrameTaskAsync(const CreateGrabFrameTaskRequest& request, const CreateGrabFrameTaskAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, createGrabFrameTask(request), context);
};
asyncExecute(new Runnable(fn));
}
ImmClient::CreateGrabFrameTaskOutcomeCallable ImmClient::createGrabFrameTaskCallable(const CreateGrabFrameTaskRequest &request) const
{
auto task = std::make_shared<std::packaged_task<CreateGrabFrameTaskOutcome()>>(
[this, request]()
{
return this->createGrabFrameTask(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
ImmClient::CreateGroupFacesJobOutcome ImmClient::createGroupFacesJob(const CreateGroupFacesJobRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();

View File

@@ -0,0 +1,104 @@
/*
* 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/CreateGrabFrameTaskRequest.h>
using AlibabaCloud::Imm::Model::CreateGrabFrameTaskRequest;
CreateGrabFrameTaskRequest::CreateGrabFrameTaskRequest() :
RpcServiceRequest("imm", "2017-09-06", "CreateGrabFrameTask")
{}
CreateGrabFrameTaskRequest::~CreateGrabFrameTaskRequest()
{}
std::string CreateGrabFrameTaskRequest::getProject()const
{
return project_;
}
void CreateGrabFrameTaskRequest::setProject(const std::string& project)
{
project_ = project;
setCoreParameter("Project", project);
}
std::string CreateGrabFrameTaskRequest::getAccessKeyId()const
{
return accessKeyId_;
}
void CreateGrabFrameTaskRequest::setAccessKeyId(const std::string& accessKeyId)
{
accessKeyId_ = accessKeyId;
setCoreParameter("AccessKeyId", accessKeyId);
}
std::string CreateGrabFrameTaskRequest::getNotifyEndpoint()const
{
return notifyEndpoint_;
}
void CreateGrabFrameTaskRequest::setNotifyEndpoint(const std::string& notifyEndpoint)
{
notifyEndpoint_ = notifyEndpoint;
setCoreParameter("NotifyEndpoint", notifyEndpoint);
}
std::string CreateGrabFrameTaskRequest::getCustomMessage()const
{
return customMessage_;
}
void CreateGrabFrameTaskRequest::setCustomMessage(const std::string& customMessage)
{
customMessage_ = customMessage;
setCoreParameter("CustomMessage", customMessage);
}
std::string CreateGrabFrameTaskRequest::getNotifyTopicName()const
{
return notifyTopicName_;
}
void CreateGrabFrameTaskRequest::setNotifyTopicName(const std::string& notifyTopicName)
{
notifyTopicName_ = notifyTopicName;
setCoreParameter("NotifyTopicName", notifyTopicName);
}
std::string CreateGrabFrameTaskRequest::getTargetList()const
{
return targetList_;
}
void CreateGrabFrameTaskRequest::setTargetList(const std::string& targetList)
{
targetList_ = targetList;
setCoreParameter("TargetList", targetList);
}
std::string CreateGrabFrameTaskRequest::getVideoUri()const
{
return videoUri_;
}
void CreateGrabFrameTaskRequest::setVideoUri(const std::string& videoUri)
{
videoUri_ = videoUri;
setCoreParameter("VideoUri", videoUri);
}

View File

@@ -0,0 +1,58 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <alibabacloud/imm/model/CreateGrabFrameTaskResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Imm;
using namespace AlibabaCloud::Imm::Model;
CreateGrabFrameTaskResult::CreateGrabFrameTaskResult() :
ServiceResult()
{}
CreateGrabFrameTaskResult::CreateGrabFrameTaskResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
CreateGrabFrameTaskResult::~CreateGrabFrameTaskResult()
{}
void CreateGrabFrameTaskResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
if(!value["TaskId"].isNull())
taskId_ = value["TaskId"].asString();
if(!value["TaskType"].isNull())
taskType_ = value["TaskType"].asString();
}
std::string CreateGrabFrameTaskResult::getTaskId()const
{
return taskId_;
}
std::string CreateGrabFrameTaskResult::getTaskType()const
{
return taskType_;
}

View File

@@ -58,6 +58,17 @@ void CreateVideoCompressTaskRequest::setNotifyEndpoint(const std::string& notify
setCoreParameter("NotifyEndpoint", notifyEndpoint);
}
std::string CreateVideoCompressTaskRequest::getCustomMessage()const
{
return customMessage_;
}
void CreateVideoCompressTaskRequest::setCustomMessage(const std::string& customMessage)
{
customMessage_ = customMessage;
setCoreParameter("CustomMessage", customMessage);
}
std::string CreateVideoCompressTaskRequest::getNotifyTopicName()const
{
return notifyTopicName_;