Generated 2022-01-30 for avatar.

This commit is contained in:
sdk-team
2023-12-28 08:47:44 +00:00
parent 1db5817d99
commit e9cb30aad0
12 changed files with 287 additions and 1 deletions

View File

@@ -195,6 +195,42 @@ AvatarClient::CloseTimedResetOperateOutcomeCallable AvatarClient::closeTimedRese
return task->get_future();
}
AvatarClient::ConfirmAvatar2dTrainOutcome AvatarClient::confirmAvatar2dTrain(const ConfirmAvatar2dTrainRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return ConfirmAvatar2dTrainOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return ConfirmAvatar2dTrainOutcome(ConfirmAvatar2dTrainResult(outcome.result()));
else
return ConfirmAvatar2dTrainOutcome(outcome.error());
}
void AvatarClient::confirmAvatar2dTrainAsync(const ConfirmAvatar2dTrainRequest& request, const ConfirmAvatar2dTrainAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, confirmAvatar2dTrain(request), context);
};
asyncExecute(new Runnable(fn));
}
AvatarClient::ConfirmAvatar2dTrainOutcomeCallable AvatarClient::confirmAvatar2dTrainCallable(const ConfirmAvatar2dTrainRequest &request) const
{
auto task = std::make_shared<std::packaged_task<ConfirmAvatar2dTrainOutcome()>>(
[this, request]()
{
return this->confirmAvatar2dTrain(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
AvatarClient::Create2dAvatarOutcome AvatarClient::create2dAvatar(const Create2dAvatarRequest &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/avatar/model/ConfirmAvatar2dTrainRequest.h>
using AlibabaCloud::Avatar::Model::ConfirmAvatar2dTrainRequest;
ConfirmAvatar2dTrainRequest::ConfirmAvatar2dTrainRequest()
: RpcServiceRequest("avatar", "2022-01-30", "ConfirmAvatar2dTrain") {
setMethod(HttpRequest::Method::Post);
}
ConfirmAvatar2dTrainRequest::~ConfirmAvatar2dTrainRequest() {}
std::string ConfirmAvatar2dTrainRequest::getConfirm() const {
return confirm_;
}
void ConfirmAvatar2dTrainRequest::setConfirm(const std::string &confirm) {
confirm_ = confirm;
setParameter(std::string("Confirm"), confirm);
}
std::string ConfirmAvatar2dTrainRequest::getCode() const {
return code_;
}
void ConfirmAvatar2dTrainRequest::setCode(const std::string &code) {
code_ = code;
setParameter(std::string("Code"), code);
}
long ConfirmAvatar2dTrainRequest::getTenantId() const {
return tenantId_;
}
void ConfirmAvatar2dTrainRequest::setTenantId(long tenantId) {
tenantId_ = tenantId;
setParameter(std::string("TenantId"), std::to_string(tenantId));
}

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.
*/
#include <alibabacloud/avatar/model/ConfirmAvatar2dTrainResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Avatar;
using namespace AlibabaCloud::Avatar::Model;
ConfirmAvatar2dTrainResult::ConfirmAvatar2dTrainResult() :
ServiceResult()
{}
ConfirmAvatar2dTrainResult::ConfirmAvatar2dTrainResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
ConfirmAvatar2dTrainResult::~ConfirmAvatar2dTrainResult()
{}
void ConfirmAvatar2dTrainResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
if(!value["Code"].isNull())
code_ = value["Code"].asString();
if(!value["Message"].isNull())
message_ = value["Message"].asString();
if(!value["Success"].isNull())
success_ = value["Success"].asString() == "true";
}
std::string ConfirmAvatar2dTrainResult::getMessage()const
{
return message_;
}
std::string ConfirmAvatar2dTrainResult::getCode()const
{
return code_;
}
bool ConfirmAvatar2dTrainResult::getSuccess()const
{
return success_;
}

View File

@@ -41,6 +41,10 @@ SubmitAudioTo2DAvatarVideoTaskRequest::AvatarInfo SubmitAudioTo2DAvatarVideoTask
void SubmitAudioTo2DAvatarVideoTaskRequest::setAvatarInfo(const SubmitAudioTo2DAvatarVideoTaskRequest::AvatarInfo &avatarInfo) {
avatarInfo_ = avatarInfo;
setParameter(std::string("AvatarInfo") + ".Code", avatarInfo.code);
setParameter(std::string("AvatarInfo") + ".X", std::to_string(avatarInfo.x));
setParameter(std::string("AvatarInfo") + ".Width", std::to_string(avatarInfo.width));
setParameter(std::string("AvatarInfo") + ".Y", std::to_string(avatarInfo.y));
setParameter(std::string("AvatarInfo") + ".Height", std::to_string(avatarInfo.height));
}
std::string SubmitAudioTo2DAvatarVideoTaskRequest::getTitle() const {

View File

@@ -53,6 +53,10 @@ SubmitTextTo2DAvatarVideoTaskRequest::AvatarInfo SubmitTextTo2DAvatarVideoTaskRe
void SubmitTextTo2DAvatarVideoTaskRequest::setAvatarInfo(const SubmitTextTo2DAvatarVideoTaskRequest::AvatarInfo &avatarInfo) {
avatarInfo_ = avatarInfo;
setParameter(std::string("AvatarInfo") + ".Code", avatarInfo.code);
setParameter(std::string("AvatarInfo") + ".X", std::to_string(avatarInfo.x));
setParameter(std::string("AvatarInfo") + ".Width", std::to_string(avatarInfo.width));
setParameter(std::string("AvatarInfo") + ".Y", std::to_string(avatarInfo.y));
setParameter(std::string("AvatarInfo") + ".Height", std::to_string(avatarInfo.height));
}
std::string SubmitTextTo2DAvatarVideoTaskRequest::getTitle() const {