Release GenerateHumanAnimeStyleVideo.

This commit is contained in:
sdk-team
2023-02-22 06:37:17 +00:00
parent bb8ddd9024
commit 3fd4f1bb94
8 changed files with 276 additions and 1 deletions

View File

@@ -41,6 +41,8 @@ set(videoenhan_public_header_model
include/alibabacloud/videoenhan/model/EraseVideoLogoResult.h
include/alibabacloud/videoenhan/model/EraseVideoSubtitlesRequest.h
include/alibabacloud/videoenhan/model/EraseVideoSubtitlesResult.h
include/alibabacloud/videoenhan/model/GenerateHumanAnimeStyleVideoRequest.h
include/alibabacloud/videoenhan/model/GenerateHumanAnimeStyleVideoResult.h
include/alibabacloud/videoenhan/model/GenerateVideoRequest.h
include/alibabacloud/videoenhan/model/GenerateVideoResult.h
include/alibabacloud/videoenhan/model/GetAsyncJobResultRequest.h
@@ -80,6 +82,8 @@ set(videoenhan_src
src/model/EraseVideoLogoResult.cc
src/model/EraseVideoSubtitlesRequest.cc
src/model/EraseVideoSubtitlesResult.cc
src/model/GenerateHumanAnimeStyleVideoRequest.cc
src/model/GenerateHumanAnimeStyleVideoResult.cc
src/model/GenerateVideoRequest.cc
src/model/GenerateVideoResult.cc
src/model/GetAsyncJobResultRequest.cc

View File

@@ -42,6 +42,8 @@
#include "model/EraseVideoLogoResult.h"
#include "model/EraseVideoSubtitlesRequest.h"
#include "model/EraseVideoSubtitlesResult.h"
#include "model/GenerateHumanAnimeStyleVideoRequest.h"
#include "model/GenerateHumanAnimeStyleVideoResult.h"
#include "model/GenerateVideoRequest.h"
#include "model/GenerateVideoResult.h"
#include "model/GetAsyncJobResultRequest.h"
@@ -97,6 +99,9 @@ namespace AlibabaCloud
typedef Outcome<Error, Model::EraseVideoSubtitlesResult> EraseVideoSubtitlesOutcome;
typedef std::future<EraseVideoSubtitlesOutcome> EraseVideoSubtitlesOutcomeCallable;
typedef std::function<void(const VideoenhanClient*, const Model::EraseVideoSubtitlesRequest&, const EraseVideoSubtitlesOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> EraseVideoSubtitlesAsyncHandler;
typedef Outcome<Error, Model::GenerateHumanAnimeStyleVideoResult> GenerateHumanAnimeStyleVideoOutcome;
typedef std::future<GenerateHumanAnimeStyleVideoOutcome> GenerateHumanAnimeStyleVideoOutcomeCallable;
typedef std::function<void(const VideoenhanClient*, const Model::GenerateHumanAnimeStyleVideoRequest&, const GenerateHumanAnimeStyleVideoOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GenerateHumanAnimeStyleVideoAsyncHandler;
typedef Outcome<Error, Model::GenerateVideoResult> GenerateVideoOutcome;
typedef std::future<GenerateVideoOutcome> GenerateVideoOutcomeCallable;
typedef std::function<void(const VideoenhanClient*, const Model::GenerateVideoRequest&, const GenerateVideoOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GenerateVideoAsyncHandler;
@@ -156,6 +161,9 @@ namespace AlibabaCloud
EraseVideoSubtitlesOutcome eraseVideoSubtitles(const Model::EraseVideoSubtitlesRequest &request)const;
void eraseVideoSubtitlesAsync(const Model::EraseVideoSubtitlesRequest& request, const EraseVideoSubtitlesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
EraseVideoSubtitlesOutcomeCallable eraseVideoSubtitlesCallable(const Model::EraseVideoSubtitlesRequest& request) const;
GenerateHumanAnimeStyleVideoOutcome generateHumanAnimeStyleVideo(const Model::GenerateHumanAnimeStyleVideoRequest &request)const;
void generateHumanAnimeStyleVideoAsync(const Model::GenerateHumanAnimeStyleVideoRequest& request, const GenerateHumanAnimeStyleVideoAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
GenerateHumanAnimeStyleVideoOutcomeCallable generateHumanAnimeStyleVideoCallable(const Model::GenerateHumanAnimeStyleVideoRequest& request) const;
GenerateVideoOutcome generateVideo(const Model::GenerateVideoRequest &request)const;
void generateVideoAsync(const Model::GenerateVideoRequest& request, const GenerateVideoAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
GenerateVideoOutcomeCallable generateVideoCallable(const Model::GenerateVideoRequest& request) const;

View File

@@ -0,0 +1,48 @@
/*
* 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_VIDEOENHAN_MODEL_GENERATEHUMANANIMESTYLEVIDEOREQUEST_H_
#define ALIBABACLOUD_VIDEOENHAN_MODEL_GENERATEHUMANANIMESTYLEVIDEOREQUEST_H_
#include <alibabacloud/videoenhan/VideoenhanExport.h>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <string>
#include <vector>
#include <map>
namespace AlibabaCloud {
namespace Videoenhan {
namespace Model {
class ALIBABACLOUD_VIDEOENHAN_EXPORT GenerateHumanAnimeStyleVideoRequest : public RpcServiceRequest {
public:
GenerateHumanAnimeStyleVideoRequest();
~GenerateHumanAnimeStyleVideoRequest();
std::string getCartoonStyle() const;
void setCartoonStyle(const std::string &cartoonStyle);
bool getAsync() const;
void setAsync(bool async);
std::string getVideoUrl() const;
void setVideoUrl(const std::string &videoUrl);
private:
std::string cartoonStyle_;
bool async_;
std::string videoUrl_;
};
} // namespace Model
} // namespace Videoenhan
} // namespace AlibabaCloud
#endif // !ALIBABACLOUD_VIDEOENHAN_MODEL_GENERATEHUMANANIMESTYLEVIDEOREQUEST_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_VIDEOENHAN_MODEL_GENERATEHUMANANIMESTYLEVIDEORESULT_H_
#define ALIBABACLOUD_VIDEOENHAN_MODEL_GENERATEHUMANANIMESTYLEVIDEORESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/videoenhan/VideoenhanExport.h>
namespace AlibabaCloud
{
namespace Videoenhan
{
namespace Model
{
class ALIBABACLOUD_VIDEOENHAN_EXPORT GenerateHumanAnimeStyleVideoResult : public ServiceResult
{
public:
struct Data
{
std::string videoUrl;
};
GenerateHumanAnimeStyleVideoResult();
explicit GenerateHumanAnimeStyleVideoResult(const std::string &payload);
~GenerateHumanAnimeStyleVideoResult();
std::string getMessage()const;
Data getData()const;
std::string getCode()const;
protected:
void parse(const std::string &payload);
private:
std::string message_;
Data data_;
std::string code_;
};
}
}
}
#endif // !ALIBABACLOUD_VIDEOENHAN_MODEL_GENERATEHUMANANIMESTYLEVIDEORESULT_H_

View File

@@ -411,6 +411,42 @@ VideoenhanClient::EraseVideoSubtitlesOutcomeCallable VideoenhanClient::eraseVide
return task->get_future();
}
VideoenhanClient::GenerateHumanAnimeStyleVideoOutcome VideoenhanClient::generateHumanAnimeStyleVideo(const GenerateHumanAnimeStyleVideoRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return GenerateHumanAnimeStyleVideoOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return GenerateHumanAnimeStyleVideoOutcome(GenerateHumanAnimeStyleVideoResult(outcome.result()));
else
return GenerateHumanAnimeStyleVideoOutcome(outcome.error());
}
void VideoenhanClient::generateHumanAnimeStyleVideoAsync(const GenerateHumanAnimeStyleVideoRequest& request, const GenerateHumanAnimeStyleVideoAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, generateHumanAnimeStyleVideo(request), context);
};
asyncExecute(new Runnable(fn));
}
VideoenhanClient::GenerateHumanAnimeStyleVideoOutcomeCallable VideoenhanClient::generateHumanAnimeStyleVideoCallable(const GenerateHumanAnimeStyleVideoRequest &request) const
{
auto task = std::make_shared<std::packaged_task<GenerateHumanAnimeStyleVideoOutcome()>>(
[this, request]()
{
return this->generateHumanAnimeStyleVideo(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
VideoenhanClient::GenerateVideoOutcome VideoenhanClient::generateVideo(const GenerateVideoRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();

View File

@@ -0,0 +1,54 @@
/*
* 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/videoenhan/model/GenerateHumanAnimeStyleVideoRequest.h>
using AlibabaCloud::Videoenhan::Model::GenerateHumanAnimeStyleVideoRequest;
GenerateHumanAnimeStyleVideoRequest::GenerateHumanAnimeStyleVideoRequest()
: RpcServiceRequest("videoenhan", "2020-03-20", "GenerateHumanAnimeStyleVideo") {
setMethod(HttpRequest::Method::Post);
}
GenerateHumanAnimeStyleVideoRequest::~GenerateHumanAnimeStyleVideoRequest() {}
std::string GenerateHumanAnimeStyleVideoRequest::getCartoonStyle() const {
return cartoonStyle_;
}
void GenerateHumanAnimeStyleVideoRequest::setCartoonStyle(const std::string &cartoonStyle) {
cartoonStyle_ = cartoonStyle;
setBodyParameter(std::string("CartoonStyle"), cartoonStyle);
}
bool GenerateHumanAnimeStyleVideoRequest::getAsync() const {
return async_;
}
void GenerateHumanAnimeStyleVideoRequest::setAsync(bool async) {
async_ = async;
setBodyParameter(std::string("Async"), async ? "true" : "false");
}
std::string GenerateHumanAnimeStyleVideoRequest::getVideoUrl() const {
return videoUrl_;
}
void GenerateHumanAnimeStyleVideoRequest::setVideoUrl(const std::string &videoUrl) {
videoUrl_ = videoUrl;
setBodyParameter(std::string("VideoUrl"), videoUrl);
}

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.
*/
#include <alibabacloud/videoenhan/model/GenerateHumanAnimeStyleVideoResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Videoenhan;
using namespace AlibabaCloud::Videoenhan::Model;
GenerateHumanAnimeStyleVideoResult::GenerateHumanAnimeStyleVideoResult() :
ServiceResult()
{}
GenerateHumanAnimeStyleVideoResult::GenerateHumanAnimeStyleVideoResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
GenerateHumanAnimeStyleVideoResult::~GenerateHumanAnimeStyleVideoResult()
{}
void GenerateHumanAnimeStyleVideoResult::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(!value["Code"].isNull())
code_ = value["Code"].asString();
if(!value["Message"].isNull())
message_ = value["Message"].asString();
}
std::string GenerateHumanAnimeStyleVideoResult::getMessage()const
{
return message_;
}
GenerateHumanAnimeStyleVideoResult::Data GenerateHumanAnimeStyleVideoResult::getData()const
{
return data_;
}
std::string GenerateHumanAnimeStyleVideoResult::getCode()const
{
return code_;
}