Supported new features for outbound.
This commit is contained in:
@@ -2427,42 +2427,6 @@ OutboundBotClient::GetEmptyNumberNoMoreCallsInfoOutcomeCallable OutboundBotClien
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
OutboundBotClient::GetInstanceConfigOutcome OutboundBotClient::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 OutboundBotClient::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));
|
||||
}
|
||||
|
||||
OutboundBotClient::GetInstanceConfigOutcomeCallable OutboundBotClient::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();
|
||||
}
|
||||
|
||||
OutboundBotClient::GetMaxAttemptsPerDayOutcome OutboundBotClient::getMaxAttemptsPerDay(const GetMaxAttemptsPerDayRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
|
||||
@@ -123,6 +123,15 @@ void CreateScriptRequest::setScriptDescription(const std::string &scriptDescript
|
||||
setParameter(std::string("ScriptDescription"), scriptDescription);
|
||||
}
|
||||
|
||||
bool CreateScriptRequest::getLongWaitEnable() const {
|
||||
return longWaitEnable_;
|
||||
}
|
||||
|
||||
void CreateScriptRequest::setLongWaitEnable(bool longWaitEnable) {
|
||||
longWaitEnable_ = longWaitEnable;
|
||||
setParameter(std::string("LongWaitEnable"), longWaitEnable ? "true" : "false");
|
||||
}
|
||||
|
||||
std::vector<std::string> CreateScriptRequest::getScriptContent() const {
|
||||
return scriptContent_;
|
||||
}
|
||||
|
||||
@@ -54,8 +54,8 @@ void DescribeScriptResult::parse(const std::string &payload)
|
||||
script_.industry = scriptNode["Industry"].asString();
|
||||
if(!scriptNode["ScriptDescription"].isNull())
|
||||
script_.scriptDescription = scriptNode["ScriptDescription"].asString();
|
||||
if(!scriptNode["MiniPlaybackConfigEnabled"].isNull())
|
||||
script_.miniPlaybackConfigEnabled = scriptNode["MiniPlaybackConfigEnabled"].asString() == "true";
|
||||
if(!scriptNode["MiniPlaybackEnable"].isNull())
|
||||
script_.miniPlaybackEnable = scriptNode["MiniPlaybackEnable"].asString() == "true";
|
||||
if(!scriptNode["IsDrafted"].isNull())
|
||||
script_.isDrafted = scriptNode["IsDrafted"].asString() == "true";
|
||||
if(!scriptNode["TtsConfig"].isNull())
|
||||
@@ -68,6 +68,10 @@ void DescribeScriptResult::parse(const std::string &payload)
|
||||
script_.scene = scriptNode["Scene"].asString();
|
||||
if(!scriptNode["ScriptName"].isNull())
|
||||
script_.scriptName = scriptNode["ScriptName"].asString();
|
||||
if(!scriptNode["NewBargeInEnable"].isNull())
|
||||
script_.newBargeInEnable = scriptNode["NewBargeInEnable"].asString() == "true";
|
||||
if(!scriptNode["LongWaitEnable"].isNull())
|
||||
script_.longWaitEnable = scriptNode["LongWaitEnable"].asString() == "true";
|
||||
if(!value["HttpStatusCode"].isNull())
|
||||
httpStatusCode_ = std::stoi(value["HttpStatusCode"].asString());
|
||||
if(!value["Success"].isNull())
|
||||
|
||||
@@ -79,3 +79,12 @@ void DescribeTTSDemoRequest::setSpeechRate(int speechRate) {
|
||||
setParameter(std::string("SpeechRate"), std::to_string(speechRate));
|
||||
}
|
||||
|
||||
int DescribeTTSDemoRequest::getPitchRate() const {
|
||||
return pitchRate_;
|
||||
}
|
||||
|
||||
void DescribeTTSDemoRequest::setPitchRate(int pitchRate) {
|
||||
pitchRate_ = pitchRate;
|
||||
setParameter(std::string("PitchRate"), std::to_string(pitchRate));
|
||||
}
|
||||
|
||||
|
||||
@@ -34,6 +34,15 @@ void DialogueRequest::setCallId(const std::string &callId) {
|
||||
setParameter(std::string("CallId"), callId);
|
||||
}
|
||||
|
||||
std::string DialogueRequest::getScriptId() const {
|
||||
return scriptId_;
|
||||
}
|
||||
|
||||
void DialogueRequest::setScriptId(const std::string &scriptId) {
|
||||
scriptId_ = scriptId;
|
||||
setParameter(std::string("ScriptId"), scriptId);
|
||||
}
|
||||
|
||||
long DialogueRequest::getInstanceOwnerId() const {
|
||||
return instanceOwnerId_;
|
||||
}
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
/*
|
||||
* 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/outboundbot/model/GetInstanceConfigRequest.h>
|
||||
|
||||
using AlibabaCloud::OutboundBot::Model::GetInstanceConfigRequest;
|
||||
|
||||
GetInstanceConfigRequest::GetInstanceConfigRequest()
|
||||
: RpcServiceRequest("outboundbot", "2019-12-26", "GetInstanceConfig") {
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
GetInstanceConfigRequest::~GetInstanceConfigRequest() {}
|
||||
|
||||
std::string GetInstanceConfigRequest::getInstanceId() const {
|
||||
return instanceId_;
|
||||
}
|
||||
|
||||
void GetInstanceConfigRequest::setInstanceId(const std::string &instanceId) {
|
||||
instanceId_ = instanceId;
|
||||
setParameter(std::string("InstanceId"), instanceId);
|
||||
}
|
||||
|
||||
@@ -1,87 +0,0 @@
|
||||
/*
|
||||
* 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/outboundbot/model/GetInstanceConfigResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::OutboundBot;
|
||||
using namespace AlibabaCloud::OutboundBot::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(!instanceConfigNode["SearchTaskFunctionSwitch"].isNull())
|
||||
data_.instanceConfig.searchTaskFunctionSwitch = instanceConfigNode["SearchTaskFunctionSwitch"].asString() == "true";
|
||||
if(!instanceConfigNode["EsAllDataKeepDay"].isNull())
|
||||
data_.instanceConfig.esAllDataKeepDay = std::stol(instanceConfigNode["EsAllDataKeepDay"].asString());
|
||||
if(!value["HttpStatusCode"].isNull())
|
||||
httpStatusCode_ = std::stoi(value["HttpStatusCode"].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 GetInstanceConfigResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
int GetInstanceConfigResult::getHttpStatusCode()const
|
||||
{
|
||||
return httpStatusCode_;
|
||||
}
|
||||
|
||||
GetInstanceConfigResult::Data GetInstanceConfigResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
std::string GetInstanceConfigResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
bool GetInstanceConfigResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
@@ -52,6 +52,8 @@ void ListAllTenantBindNumberBindingResult::parse(const std::string &payload)
|
||||
listItemObject.trunkName = dataNodeListListItem["TrunkName"].asString();
|
||||
if(!dataNodeListListItem["SerializedParams"].isNull())
|
||||
listItemObject.serializedParams = dataNodeListListItem["SerializedParams"].asString();
|
||||
if(!dataNodeListListItem["BillingType"].isNull())
|
||||
listItemObject.billingType = dataNodeListListItem["BillingType"].asString();
|
||||
auto allInstanceNameList = value["InstanceNameList"]["InstanceNameList"];
|
||||
for (auto value : allInstanceNameList)
|
||||
listItemObject.instanceNameList.push_back(value.asString());
|
||||
|
||||
@@ -66,8 +66,8 @@ void ListScriptsResult::parse(const std::string &payload)
|
||||
scriptObject.isDrafted = scriptsNodeListScript["IsDrafted"].asString() == "true";
|
||||
if(!scriptsNodeListScript["DebugStatus"].isNull())
|
||||
scriptObject.debugStatus = scriptsNodeListScript["DebugStatus"].asString();
|
||||
if(!scriptsNodeListScript["MiniPlaybackEnabled"].isNull())
|
||||
scriptObject.miniPlaybackEnabled = scriptsNodeListScript["MiniPlaybackEnabled"].asString() == "true";
|
||||
if(!scriptsNodeListScript["MiniPlaybackEnable"].isNull())
|
||||
scriptObject.miniPlaybackEnable = scriptsNodeListScript["MiniPlaybackEnable"].asString() == "true";
|
||||
if(!scriptsNodeListScript["RejectReason"].isNull())
|
||||
scriptObject.rejectReason = scriptsNodeListScript["RejectReason"].asString();
|
||||
if(!scriptsNodeListScript["FailReason"].isNull())
|
||||
@@ -78,6 +78,8 @@ void ListScriptsResult::parse(const std::string &payload)
|
||||
scriptObject.scriptName = scriptsNodeListScript["ScriptName"].asString();
|
||||
if(!scriptsNodeListScript["NewBargeInEnable"].isNull())
|
||||
scriptObject.newBargeInEnable = scriptsNodeListScript["NewBargeInEnable"].asString() == "true";
|
||||
if(!scriptsNodeListScript["LongWaitEnable"].isNull())
|
||||
scriptObject.longWaitEnable = scriptsNodeListScript["LongWaitEnable"].asString() == "true";
|
||||
scripts_.list.push_back(scriptObject);
|
||||
}
|
||||
if(!value["HttpStatusCode"].isNull())
|
||||
|
||||
@@ -96,13 +96,22 @@ void ModifyScriptRequest::setNlsConfig(const std::string &nlsConfig) {
|
||||
setParameter(std::string("NlsConfig"), nlsConfig);
|
||||
}
|
||||
|
||||
bool ModifyScriptRequest::getMiniPlaybackEnabled() const {
|
||||
return miniPlaybackEnabled_;
|
||||
bool ModifyScriptRequest::getNewBargeInEnable() const {
|
||||
return newBargeInEnable_;
|
||||
}
|
||||
|
||||
void ModifyScriptRequest::setMiniPlaybackEnabled(bool miniPlaybackEnabled) {
|
||||
miniPlaybackEnabled_ = miniPlaybackEnabled;
|
||||
setParameter(std::string("MiniPlaybackEnabled"), miniPlaybackEnabled ? "true" : "false");
|
||||
void ModifyScriptRequest::setNewBargeInEnable(bool newBargeInEnable) {
|
||||
newBargeInEnable_ = newBargeInEnable;
|
||||
setParameter(std::string("NewBargeInEnable"), newBargeInEnable ? "true" : "false");
|
||||
}
|
||||
|
||||
bool ModifyScriptRequest::getMiniPlaybackEnable() const {
|
||||
return miniPlaybackEnable_;
|
||||
}
|
||||
|
||||
void ModifyScriptRequest::setMiniPlaybackEnable(bool miniPlaybackEnable) {
|
||||
miniPlaybackEnable_ = miniPlaybackEnable;
|
||||
setParameter(std::string("MiniPlaybackEnable"), miniPlaybackEnable ? "true" : "false");
|
||||
}
|
||||
|
||||
std::string ModifyScriptRequest::getChatbotId() const {
|
||||
@@ -132,6 +141,15 @@ void ModifyScriptRequest::setScriptDescription(const std::string &scriptDescript
|
||||
setParameter(std::string("ScriptDescription"), scriptDescription);
|
||||
}
|
||||
|
||||
bool ModifyScriptRequest::getLongWaitEnable() const {
|
||||
return longWaitEnable_;
|
||||
}
|
||||
|
||||
void ModifyScriptRequest::setLongWaitEnable(bool longWaitEnable) {
|
||||
longWaitEnable_ = longWaitEnable;
|
||||
setParameter(std::string("LongWaitEnable"), longWaitEnable ? "true" : "false");
|
||||
}
|
||||
|
||||
std::vector<std::string> ModifyScriptRequest::getScriptContent() const {
|
||||
return scriptContent_;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user