Supported Api EraseLogoInVideo.

This commit is contained in:
sdk-team
2020-06-26 17:48:17 +08:00
parent 1ae8883f81
commit 59d9eaf390
13 changed files with 613 additions and 4 deletions

View File

@@ -31,21 +31,21 @@ IvpdClient::IvpdClient(const Credentials &credentials, const ClientConfiguration
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, "");
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "ivpd");
}
IvpdClient::IvpdClient(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, "");
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "ivpd");
}
IvpdClient::IvpdClient(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, "");
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "ivpd");
}
IvpdClient::~IvpdClient()
@@ -159,6 +159,42 @@ IvpdClient::DetectImageElementsOutcomeCallable IvpdClient::detectImageElementsCa
return task->get_future();
}
IvpdClient::EraseLogoInVideoOutcome IvpdClient::eraseLogoInVideo(const EraseLogoInVideoRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return EraseLogoInVideoOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return EraseLogoInVideoOutcome(EraseLogoInVideoResult(outcome.result()));
else
return EraseLogoInVideoOutcome(outcome.error());
}
void IvpdClient::eraseLogoInVideoAsync(const EraseLogoInVideoRequest& request, const EraseLogoInVideoAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, eraseLogoInVideo(request), context);
};
asyncExecute(new Runnable(fn));
}
IvpdClient::EraseLogoInVideoOutcomeCallable IvpdClient::eraseLogoInVideoCallable(const EraseLogoInVideoRequest &request) const
{
auto task = std::make_shared<std::packaged_task<EraseLogoInVideoOutcome()>>(
[this, request]()
{
return this->eraseLogoInVideo(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
IvpdClient::ExtendImageStyleOutcome IvpdClient::extendImageStyle(const ExtendImageStyleRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -195,6 +231,42 @@ IvpdClient::ExtendImageStyleOutcomeCallable IvpdClient::extendImageStyleCallable
return task->get_future();
}
IvpdClient::GetAsyncResultOutcome IvpdClient::getAsyncResult(const GetAsyncResultRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return GetAsyncResultOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return GetAsyncResultOutcome(GetAsyncResultResult(outcome.result()));
else
return GetAsyncResultOutcome(outcome.error());
}
void IvpdClient::getAsyncResultAsync(const GetAsyncResultRequest& request, const GetAsyncResultAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, getAsyncResult(request), context);
};
asyncExecute(new Runnable(fn));
}
IvpdClient::GetAsyncResultOutcomeCallable IvpdClient::getAsyncResultCallable(const GetAsyncResultRequest &request) const
{
auto task = std::make_shared<std::packaged_task<GetAsyncResultOutcome()>>(
[this, request]()
{
return this->getAsyncResult(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
IvpdClient::GetJobResultOutcome IvpdClient::getJobResult(const GetJobResultRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();

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/ivpd/model/EraseLogoInVideoRequest.h>
using AlibabaCloud::Ivpd::Model::EraseLogoInVideoRequest;
EraseLogoInVideoRequest::EraseLogoInVideoRequest() :
RpcServiceRequest("ivpd", "2019-06-25", "EraseLogoInVideo")
{
setMethod(HttpRequest::Method::Post);
}
EraseLogoInVideoRequest::~EraseLogoInVideoRequest()
{}
std::vector<EraseLogoInVideoRequest::Boxes> EraseLogoInVideoRequest::getBoxes()const
{
return boxes_;
}
void EraseLogoInVideoRequest::setBoxes(const std::vector<Boxes>& boxes)
{
boxes_ = boxes;
for(int dep1 = 0; dep1!= boxes.size(); dep1++) {
auto boxesObj = boxes.at(dep1);
std::string boxesObjStr = "Boxes." + std::to_string(dep1 + 1);
setParameter(boxesObjStr + ".W", std::to_string(boxesObj.w));
setParameter(boxesObjStr + ".H", std::to_string(boxesObj.h));
setParameter(boxesObjStr + ".X", std::to_string(boxesObj.x));
setParameter(boxesObjStr + ".Y", std::to_string(boxesObj.y));
}
}
bool EraseLogoInVideoRequest::getAsync()const
{
return async_;
}
void EraseLogoInVideoRequest::setAsync(bool async)
{
async_ = async;
setBodyParameter("Async", async ? "true" : "false");
}
std::string EraseLogoInVideoRequest::getJobId()const
{
return jobId_;
}
void EraseLogoInVideoRequest::setJobId(const std::string& jobId)
{
jobId_ = jobId;
setBodyParameter("JobId", jobId);
}
std::string EraseLogoInVideoRequest::getVideoUrl()const
{
return videoUrl_;
}
void EraseLogoInVideoRequest::setVideoUrl(const std::string& videoUrl)
{
videoUrl_ = videoUrl;
setBodyParameter("VideoUrl", videoUrl);
}

View File

@@ -0,0 +1,68 @@
/*
* 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/ivpd/model/EraseLogoInVideoResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Ivpd;
using namespace AlibabaCloud::Ivpd::Model;
EraseLogoInVideoResult::EraseLogoInVideoResult() :
ServiceResult()
{}
EraseLogoInVideoResult::EraseLogoInVideoResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
EraseLogoInVideoResult::~EraseLogoInVideoResult()
{}
void EraseLogoInVideoResult::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["VideoUrl"].isNull())
data_.videoUrl = dataNode["VideoUrl"].asString();
if(!dataNode["JobId"].isNull())
data_.jobId = dataNode["JobId"].asString();
if(!value["Code"].isNull())
code_ = value["Code"].asString();
if(!value["Message"].isNull())
message_ = value["Message"].asString();
}
std::string EraseLogoInVideoResult::getMessage()const
{
return message_;
}
EraseLogoInVideoResult::Data EraseLogoInVideoResult::getData()const
{
return data_;
}
std::string EraseLogoInVideoResult::getCode()const
{
return code_;
}

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/ivpd/model/GetAsyncResultRequest.h>
using AlibabaCloud::Ivpd::Model::GetAsyncResultRequest;
GetAsyncResultRequest::GetAsyncResultRequest() :
RpcServiceRequest("ivpd", "2019-06-25", "GetAsyncResult")
{
setMethod(HttpRequest::Method::Post);
}
GetAsyncResultRequest::~GetAsyncResultRequest()
{}
std::string GetAsyncResultRequest::getJobId()const
{
return jobId_;
}
void GetAsyncResultRequest::setJobId(const std::string& jobId)
{
jobId_ = jobId;
setBodyParameter("JobId", jobId);
}

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/ivpd/model/GetAsyncResultResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Ivpd;
using namespace AlibabaCloud::Ivpd::Model;
GetAsyncResultResult::GetAsyncResultResult() :
ServiceResult()
{}
GetAsyncResultResult::GetAsyncResultResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
GetAsyncResultResult::~GetAsyncResultResult()
{}
void GetAsyncResultResult::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["Status"].isNull())
data_.status = dataNode["Status"].asString();
if(!dataNode["BatchSize"].isNull())
data_.batchSize = dataNode["BatchSize"].asString();
if(!dataNode["Finish"].isNull())
data_.finish = dataNode["Finish"].asString() == "true";
if(!dataNode["Progress"].isNull())
data_.progress = std::stof(dataNode["Progress"].asString());
if(!dataNode["Message"].isNull())
data_.message = dataNode["Message"].asString();
if(!dataNode["Completed"].isNull())
data_.completed = dataNode["Completed"].asString() == "true";
if(!dataNode["TotalUsedTime"].isNull())
data_.totalUsedTime = std::stol(dataNode["TotalUsedTime"].asString());
if(!dataNode["Result"].isNull())
data_.result = dataNode["Result"].asString();
if(!dataNode["Code"].isNull())
data_.code = dataNode["Code"].asString();
if(!value["Code"].isNull())
code_ = value["Code"].asString();
if(!value["Message"].isNull())
message_ = value["Message"].asString();
}
std::string GetAsyncResultResult::getMessage()const
{
return message_;
}
GetAsyncResultResult::Data GetAsyncResultResult::getData()const
{
return data_;
}
std::string GetAsyncResultResult::getCode()const
{
return code_;
}