Supported new features etc.

This commit is contained in:
sdk-team
2021-12-29 06:58:14 +00:00
parent 1f47213704
commit dacf4c261f
21 changed files with 868 additions and 3 deletions

View File

@@ -987,6 +987,78 @@ VoiceNavigatorClient::ExportStatisticalDataOutcomeCallable VoiceNavigatorClient:
return task->get_future();
}
VoiceNavigatorClient::GetInstanceConfigOutcome VoiceNavigatorClient::getInstanceConfig(const GetInstanceConfigRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return GetInstanceConfigOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return GetInstanceConfigOutcome(GetInstanceConfigResult(outcome.result()));
else
return GetInstanceConfigOutcome(outcome.error());
}
void VoiceNavigatorClient::getInstanceConfigAsync(const GetInstanceConfigRequest& request, const GetInstanceConfigAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, getInstanceConfig(request), context);
};
asyncExecute(new Runnable(fn));
}
VoiceNavigatorClient::GetInstanceConfigOutcomeCallable VoiceNavigatorClient::getInstanceConfigCallable(const GetInstanceConfigRequest &request) const
{
auto task = std::make_shared<std::packaged_task<GetInstanceConfigOutcome()>>(
[this, request]()
{
return this->getInstanceConfig(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
VoiceNavigatorClient::GetNewBargeInSwitchOutcome VoiceNavigatorClient::getNewBargeInSwitch(const GetNewBargeInSwitchRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return GetNewBargeInSwitchOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return GetNewBargeInSwitchOutcome(GetNewBargeInSwitchResult(outcome.result()));
else
return GetNewBargeInSwitchOutcome(outcome.error());
}
void VoiceNavigatorClient::getNewBargeInSwitchAsync(const GetNewBargeInSwitchRequest& request, const GetNewBargeInSwitchAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, getNewBargeInSwitch(request), context);
};
asyncExecute(new Runnable(fn));
}
VoiceNavigatorClient::GetNewBargeInSwitchOutcomeCallable VoiceNavigatorClient::getNewBargeInSwitchCallable(const GetNewBargeInSwitchRequest &request) const
{
auto task = std::make_shared<std::packaged_task<GetNewBargeInSwitchOutcome()>>(
[this, request]()
{
return this->getNewBargeInSwitch(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
VoiceNavigatorClient::ListChatbotInstancesOutcome VoiceNavigatorClient::listChatbotInstances(const ListChatbotInstancesRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -1491,3 +1563,39 @@ VoiceNavigatorClient::SilenceTimeoutOutcomeCallable VoiceNavigatorClient::silenc
return task->get_future();
}
VoiceNavigatorClient::UpdateNewBargeInSwitchOutcome VoiceNavigatorClient::updateNewBargeInSwitch(const UpdateNewBargeInSwitchRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return UpdateNewBargeInSwitchOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return UpdateNewBargeInSwitchOutcome(UpdateNewBargeInSwitchResult(outcome.result()));
else
return UpdateNewBargeInSwitchOutcome(outcome.error());
}
void VoiceNavigatorClient::updateNewBargeInSwitchAsync(const UpdateNewBargeInSwitchRequest& request, const UpdateNewBargeInSwitchAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, updateNewBargeInSwitch(request), context);
};
asyncExecute(new Runnable(fn));
}
VoiceNavigatorClient::UpdateNewBargeInSwitchOutcomeCallable VoiceNavigatorClient::updateNewBargeInSwitchCallable(const UpdateNewBargeInSwitchRequest &request) const
{
auto task = std::make_shared<std::packaged_task<UpdateNewBargeInSwitchOutcome()>>(
[this, request]()
{
return this->updateNewBargeInSwitch(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}

View File

@@ -38,6 +38,17 @@ void EndDialogueRequest::setConversationId(const std::string& conversationId)
setParameter("ConversationId", conversationId);
}
std::string EndDialogueRequest::getHangUpParams()const
{
return hangUpParams_;
}
void EndDialogueRequest::setHangUpParams(const std::string& hangUpParams)
{
hangUpParams_ = hangUpParams;
setParameter("HangUpParams", hangUpParams);
}
std::string EndDialogueRequest::getInstanceId()const
{
return instanceId_;

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/voicenavigator/model/GetInstanceConfigRequest.h>
using AlibabaCloud::VoiceNavigator::Model::GetInstanceConfigRequest;
GetInstanceConfigRequest::GetInstanceConfigRequest() :
RpcServiceRequest("voicenavigator", "2018-06-12", "GetInstanceConfig")
{
setMethod(HttpRequest::Method::Post);
}
GetInstanceConfigRequest::~GetInstanceConfigRequest()
{}
std::string GetInstanceConfigRequest::getInstanceId()const
{
return instanceId_;
}
void GetInstanceConfigRequest::setInstanceId(const std::string& instanceId)
{
instanceId_ = instanceId;
setParameter("InstanceId", instanceId);
}

View File

@@ -0,0 +1,83 @@
/*
* 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/voicenavigator/model/GetInstanceConfigResult.h>
#include <json/json.h>
using namespace AlibabaCloud::VoiceNavigator;
using namespace AlibabaCloud::VoiceNavigator::Model;
GetInstanceConfigResult::GetInstanceConfigResult() :
ServiceResult()
{}
GetInstanceConfigResult::GetInstanceConfigResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
GetInstanceConfigResult::~GetInstanceConfigResult()
{}
void GetInstanceConfigResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto dataNode = value["Data"];
auto instanceConfigNode = dataNode["InstanceConfig"];
if(!instanceConfigNode["MiniPlaybackSystemSwitch"].isNull())
data_.instanceConfig.miniPlaybackSystemSwitch = instanceConfigNode["MiniPlaybackSystemSwitch"].asString() == "true";
if(!instanceConfigNode["NewBargeInSystemSwitch"].isNull())
data_.instanceConfig.newBargeInSystemSwitch = instanceConfigNode["NewBargeInSystemSwitch"].asString() == "true";
if(!value["Success"].isNull())
success_ = value["Success"].asString() == "true";
if(!value["HttpStatusCode"].isNull())
httpStatusCode_ = std::stoi(value["HttpStatusCode"].asString());
if(!value["Code"].isNull())
code_ = value["Code"].asString();
if(!value["ErrorMsg"].isNull())
errorMsg_ = value["ErrorMsg"].asString();
}
int GetInstanceConfigResult::getHttpStatusCode()const
{
return httpStatusCode_;
}
std::string GetInstanceConfigResult::getErrorMsg()const
{
return errorMsg_;
}
GetInstanceConfigResult::Data GetInstanceConfigResult::getData()const
{
return data_;
}
std::string GetInstanceConfigResult::getCode()const
{
return code_;
}
bool GetInstanceConfigResult::getSuccess()const
{
return success_;
}

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/voicenavigator/model/GetNewBargeInSwitchRequest.h>
using AlibabaCloud::VoiceNavigator::Model::GetNewBargeInSwitchRequest;
GetNewBargeInSwitchRequest::GetNewBargeInSwitchRequest() :
RpcServiceRequest("voicenavigator", "2018-06-12", "GetNewBargeInSwitch")
{
setMethod(HttpRequest::Method::Post);
}
GetNewBargeInSwitchRequest::~GetNewBargeInSwitchRequest()
{}
std::string GetNewBargeInSwitchRequest::getInstanceId()const
{
return instanceId_;
}
void GetNewBargeInSwitchRequest::setInstanceId(const std::string& instanceId)
{
instanceId_ = instanceId;
setParameter("InstanceId", instanceId);
}

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/voicenavigator/model/GetNewBargeInSwitchResult.h>
#include <json/json.h>
using namespace AlibabaCloud::VoiceNavigator;
using namespace AlibabaCloud::VoiceNavigator::Model;
GetNewBargeInSwitchResult::GetNewBargeInSwitchResult() :
ServiceResult()
{}
GetNewBargeInSwitchResult::GetNewBargeInSwitchResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
GetNewBargeInSwitchResult::~GetNewBargeInSwitchResult()
{}
void GetNewBargeInSwitchResult::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["Enable"].isNull())
data_.enable = dataNode["Enable"].asString() == "true";
if(!value["Success"].isNull())
success_ = value["Success"].asString() == "true";
if(!value["HttpStatusCode"].isNull())
httpStatusCode_ = std::stoi(value["HttpStatusCode"].asString());
if(!value["Code"].isNull())
code_ = value["Code"].asString();
if(!value["ErrorMsg"].isNull())
errorMsg_ = value["ErrorMsg"].asString();
}
int GetNewBargeInSwitchResult::getHttpStatusCode()const
{
return httpStatusCode_;
}
std::string GetNewBargeInSwitchResult::getErrorMsg()const
{
return errorMsg_;
}
GetNewBargeInSwitchResult::Data GetNewBargeInSwitchResult::getData()const
{
return data_;
}
std::string GetNewBargeInSwitchResult::getCode()const
{
return code_;
}
bool GetNewBargeInSwitchResult::getSuccess()const
{
return success_;
}

View File

@@ -59,6 +59,8 @@ void ListConversationsResult::parse(const std::string &payload)
conversationsObject.endReason = std::stoi(valueConversationsConversation["EndReason"].asString());
if(!valueConversationsConversation["Rounds"].isNull())
conversationsObject.rounds = std::stoi(valueConversationsConversation["Rounds"].asString());
if(!valueConversationsConversation["HasLastPlaybackCompleted"].isNull())
conversationsObject.hasLastPlaybackCompleted = valueConversationsConversation["HasLastPlaybackCompleted"].asString() == "true";
conversations_.push_back(conversationsObject);
}
if(!value["TotalCount"].isNull())

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/voicenavigator/model/UpdateNewBargeInSwitchRequest.h>
using AlibabaCloud::VoiceNavigator::Model::UpdateNewBargeInSwitchRequest;
UpdateNewBargeInSwitchRequest::UpdateNewBargeInSwitchRequest() :
RpcServiceRequest("voicenavigator", "2018-06-12", "UpdateNewBargeInSwitch")
{
setMethod(HttpRequest::Method::Post);
}
UpdateNewBargeInSwitchRequest::~UpdateNewBargeInSwitchRequest()
{}
std::string UpdateNewBargeInSwitchRequest::getInstanceId()const
{
return instanceId_;
}
void UpdateNewBargeInSwitchRequest::setInstanceId(const std::string& instanceId)
{
instanceId_ = instanceId;
setParameter("InstanceId", instanceId);
}
bool UpdateNewBargeInSwitchRequest::getEnable()const
{
return enable_;
}
void UpdateNewBargeInSwitchRequest::setEnable(bool enable)
{
enable_ = enable;
setParameter("Enable", enable ? "true" : "false");
}

View File

@@ -0,0 +1,72 @@
/*
* 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/voicenavigator/model/UpdateNewBargeInSwitchResult.h>
#include <json/json.h>
using namespace AlibabaCloud::VoiceNavigator;
using namespace AlibabaCloud::VoiceNavigator::Model;
UpdateNewBargeInSwitchResult::UpdateNewBargeInSwitchResult() :
ServiceResult()
{}
UpdateNewBargeInSwitchResult::UpdateNewBargeInSwitchResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
UpdateNewBargeInSwitchResult::~UpdateNewBargeInSwitchResult()
{}
void UpdateNewBargeInSwitchResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
if(!value["Success"].isNull())
success_ = value["Success"].asString() == "true";
if(!value["HttpStatusCode"].isNull())
httpStatusCode_ = std::stoi(value["HttpStatusCode"].asString());
if(!value["Code"].isNull())
code_ = value["Code"].asString();
if(!value["ErrorMsg"].isNull())
errorMsg_ = value["ErrorMsg"].asString();
}
int UpdateNewBargeInSwitchResult::getHttpStatusCode()const
{
return httpStatusCode_;
}
std::string UpdateNewBargeInSwitchResult::getErrorMsg()const
{
return errorMsg_;
}
std::string UpdateNewBargeInSwitchResult::getCode()const
{
return code_;
}
bool UpdateNewBargeInSwitchResult::getSuccess()const
{
return success_;
}