Supported image for process.

This commit is contained in:
sdk-team
2019-12-31 13:56:15 +08:00
parent 1e36d3c54a
commit 76dd650cd7
13 changed files with 629 additions and 1 deletions

View File

@@ -303,6 +303,42 @@ ImmClient::CreateGroupFacesJobOutcomeCallable ImmClient::createGroupFacesJobCall
return task->get_future();
}
ImmClient::CreateImageProcessTaskOutcome ImmClient::createImageProcessTask(const CreateImageProcessTaskRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return CreateImageProcessTaskOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return CreateImageProcessTaskOutcome(CreateImageProcessTaskResult(outcome.result()));
else
return CreateImageProcessTaskOutcome(outcome.error());
}
void ImmClient::createImageProcessTaskAsync(const CreateImageProcessTaskRequest& request, const CreateImageProcessTaskAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, createImageProcessTask(request), context);
};
asyncExecute(new Runnable(fn));
}
ImmClient::CreateImageProcessTaskOutcomeCallable ImmClient::createImageProcessTaskCallable(const CreateImageProcessTaskRequest &request) const
{
auto task = std::make_shared<std::packaged_task<CreateImageProcessTaskOutcome()>>(
[this, request]()
{
return this->createImageProcessTask(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
ImmClient::CreateMediaComplexTaskOutcome ImmClient::createMediaComplexTask(const CreateMediaComplexTaskRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -1635,6 +1671,42 @@ ImmClient::GetOfficeConversionTaskOutcomeCallable ImmClient::getOfficeConversion
return task->get_future();
}
ImmClient::GetOfficePreviewURLOutcome ImmClient::getOfficePreviewURL(const GetOfficePreviewURLRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return GetOfficePreviewURLOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return GetOfficePreviewURLOutcome(GetOfficePreviewURLResult(outcome.result()));
else
return GetOfficePreviewURLOutcome(outcome.error());
}
void ImmClient::getOfficePreviewURLAsync(const GetOfficePreviewURLRequest& request, const GetOfficePreviewURLAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, getOfficePreviewURL(request), context);
};
asyncExecute(new Runnable(fn));
}
ImmClient::GetOfficePreviewURLOutcomeCallable ImmClient::getOfficePreviewURLCallable(const GetOfficePreviewURLRequest &request) const
{
auto task = std::make_shared<std::packaged_task<GetOfficePreviewURLOutcome()>>(
[this, request]()
{
return this->getOfficePreviewURL(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
ImmClient::GetProjectOutcome ImmClient::getProject(const GetProjectRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();

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/imm/model/CreateImageProcessTaskRequest.h>
using AlibabaCloud::Imm::Model::CreateImageProcessTaskRequest;
CreateImageProcessTaskRequest::CreateImageProcessTaskRequest() :
RpcServiceRequest("imm", "2017-09-06", "CreateImageProcessTask")
{
setMethod(HttpRequest::Method::Post);
}
CreateImageProcessTaskRequest::~CreateImageProcessTaskRequest()
{}
std::string CreateImageProcessTaskRequest::getProject()const
{
return project_;
}
void CreateImageProcessTaskRequest::setProject(const std::string& project)
{
project_ = project;
setCoreParameter("Project", project);
}
std::string CreateImageProcessTaskRequest::getAccessKeyId()const
{
return accessKeyId_;
}
void CreateImageProcessTaskRequest::setAccessKeyId(const std::string& accessKeyId)
{
accessKeyId_ = accessKeyId;
setCoreParameter("AccessKeyId", accessKeyId);
}
std::string CreateImageProcessTaskRequest::getNotifyEndpoint()const
{
return notifyEndpoint_;
}
void CreateImageProcessTaskRequest::setNotifyEndpoint(const std::string& notifyEndpoint)
{
notifyEndpoint_ = notifyEndpoint;
setCoreParameter("NotifyEndpoint", notifyEndpoint);
}
std::string CreateImageProcessTaskRequest::getNotifyTopicName()const
{
return notifyTopicName_;
}
void CreateImageProcessTaskRequest::setNotifyTopicName(const std::string& notifyTopicName)
{
notifyTopicName_ = notifyTopicName;
setCoreParameter("NotifyTopicName", notifyTopicName);
}
std::string CreateImageProcessTaskRequest::getTargetList()const
{
return targetList_;
}
void CreateImageProcessTaskRequest::setTargetList(const std::string& targetList)
{
targetList_ = targetList;
setCoreParameter("TargetList", targetList);
}
std::string CreateImageProcessTaskRequest::getImageUri()const
{
return imageUri_;
}
void CreateImageProcessTaskRequest::setImageUri(const std::string& imageUri)
{
imageUri_ = imageUri;
setCoreParameter("ImageUri", imageUri);
}

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/CreateImageProcessTaskResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Imm;
using namespace AlibabaCloud::Imm::Model;
CreateImageProcessTaskResult::CreateImageProcessTaskResult() :
ServiceResult()
{}
CreateImageProcessTaskResult::CreateImageProcessTaskResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
CreateImageProcessTaskResult::~CreateImageProcessTaskResult()
{}
void CreateImageProcessTaskResult::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 CreateImageProcessTaskResult::getTaskId()const
{
return taskId_;
}
std::string CreateImageProcessTaskResult::getTaskType()const
{
return taskType_;
}

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/imm/model/GetOfficePreviewURLRequest.h>
using AlibabaCloud::Imm::Model::GetOfficePreviewURLRequest;
GetOfficePreviewURLRequest::GetOfficePreviewURLRequest() :
RpcServiceRequest("imm", "2017-09-06", "GetOfficePreviewURL")
{
setMethod(HttpRequest::Method::Post);
}
GetOfficePreviewURLRequest::~GetOfficePreviewURLRequest()
{}
std::string GetOfficePreviewURLRequest::getSrcType()const
{
return srcType_;
}
void GetOfficePreviewURLRequest::setSrcType(const std::string& srcType)
{
srcType_ = srcType;
setCoreParameter("SrcType", srcType);
}
int GetOfficePreviewURLRequest::getExpires()const
{
return expires_;
}
void GetOfficePreviewURLRequest::setExpires(int expires)
{
expires_ = expires;
setCoreParameter("Expires", std::to_string(expires));
}
std::string GetOfficePreviewURLRequest::getProject()const
{
return project_;
}
void GetOfficePreviewURLRequest::setProject(const std::string& project)
{
project_ = project;
setCoreParameter("Project", project);
}
std::string GetOfficePreviewURLRequest::getAccessKeyId()const
{
return accessKeyId_;
}
void GetOfficePreviewURLRequest::setAccessKeyId(const std::string& accessKeyId)
{
accessKeyId_ = accessKeyId;
setCoreParameter("AccessKeyId", accessKeyId);
}
bool GetOfficePreviewURLRequest::getUseHTTPS()const
{
return useHTTPS_;
}
void GetOfficePreviewURLRequest::setUseHTTPS(bool useHTTPS)
{
useHTTPS_ = useHTTPS;
setCoreParameter("UseHTTPS", useHTTPS ? "true" : "false");
}
std::string GetOfficePreviewURLRequest::getSrcUri()const
{
return srcUri_;
}
void GetOfficePreviewURLRequest::setSrcUri(const std::string& srcUri)
{
srcUri_ = srcUri;
setCoreParameter("SrcUri", srcUri);
}

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/imm/model/GetOfficePreviewURLResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Imm;
using namespace AlibabaCloud::Imm::Model;
GetOfficePreviewURLResult::GetOfficePreviewURLResult() :
ServiceResult()
{}
GetOfficePreviewURLResult::GetOfficePreviewURLResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
GetOfficePreviewURLResult::~GetOfficePreviewURLResult()
{}
void GetOfficePreviewURLResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
if(!value["PreviewURL"].isNull())
previewURL_ = value["PreviewURL"].asString();
}
std::string GetOfficePreviewURLResult::getPreviewURL()const
{
return previewURL_;
}