Supported scheduler for outbound call.

This commit is contained in:
sdk-team
2021-02-04 06:57:45 +00:00
parent fb12252d2d
commit ee902a7f28
16 changed files with 891 additions and 0 deletions

View File

@@ -1311,6 +1311,42 @@ OutboundBotClient::ImportScriptOutcomeCallable OutboundBotClient::importScriptCa
return task->get_future();
}
OutboundBotClient::InflightTaskTimeoutOutcome OutboundBotClient::inflightTaskTimeout(const InflightTaskTimeoutRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return InflightTaskTimeoutOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return InflightTaskTimeoutOutcome(InflightTaskTimeoutResult(outcome.result()));
else
return InflightTaskTimeoutOutcome(outcome.error());
}
void OutboundBotClient::inflightTaskTimeoutAsync(const InflightTaskTimeoutRequest& request, const InflightTaskTimeoutAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, inflightTaskTimeout(request), context);
};
asyncExecute(new Runnable(fn));
}
OutboundBotClient::InflightTaskTimeoutOutcomeCallable OutboundBotClient::inflightTaskTimeoutCallable(const InflightTaskTimeoutRequest &request) const
{
auto task = std::make_shared<std::packaged_task<InflightTaskTimeoutOutcome()>>(
[this, request]()
{
return this->inflightTaskTimeout(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OutboundBotClient::ListDialogueFlowsOutcome OutboundBotClient::listDialogueFlows(const ListDialogueFlowsRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -1635,6 +1671,42 @@ OutboundBotClient::ListOutboundCallNumbersOutcomeCallable OutboundBotClient::lis
return task->get_future();
}
OutboundBotClient::ListSchedulerInstancesOutcome OutboundBotClient::listSchedulerInstances(const ListSchedulerInstancesRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return ListSchedulerInstancesOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return ListSchedulerInstancesOutcome(ListSchedulerInstancesResult(outcome.result()));
else
return ListSchedulerInstancesOutcome(outcome.error());
}
void OutboundBotClient::listSchedulerInstancesAsync(const ListSchedulerInstancesRequest& request, const ListSchedulerInstancesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, listSchedulerInstances(request), context);
};
asyncExecute(new Runnable(fn));
}
OutboundBotClient::ListSchedulerInstancesOutcomeCallable OutboundBotClient::listSchedulerInstancesCallable(const ListSchedulerInstancesRequest &request) const
{
auto task = std::make_shared<std::packaged_task<ListSchedulerInstancesOutcome()>>(
[this, request]()
{
return this->listSchedulerInstances(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OutboundBotClient::ListScriptPublishHistoriesOutcome OutboundBotClient::listScriptPublishHistories(const ListScriptPublishHistoriesRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -2643,6 +2715,42 @@ OutboundBotClient::SuspendJobsOutcomeCallable OutboundBotClient::suspendJobsCall
return task->get_future();
}
OutboundBotClient::TaskPreparingOutcome OutboundBotClient::taskPreparing(const TaskPreparingRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return TaskPreparingOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return TaskPreparingOutcome(TaskPreparingResult(outcome.result()));
else
return TaskPreparingOutcome(outcome.error());
}
void OutboundBotClient::taskPreparingAsync(const TaskPreparingRequest& request, const TaskPreparingAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, taskPreparing(request), context);
};
asyncExecute(new Runnable(fn));
}
OutboundBotClient::TaskPreparingOutcomeCallable OutboundBotClient::taskPreparingCallable(const TaskPreparingRequest &request) const
{
auto task = std::make_shared<std::packaged_task<TaskPreparingOutcome()>>(
[this, request]()
{
return this->taskPreparing(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OutboundBotClient::WithdrawScriptReviewOutcome OutboundBotClient::withdrawScriptReview(const WithdrawScriptReviewRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();

View File

@@ -0,0 +1,62 @@
/*
* 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/InflightTaskTimeoutRequest.h>
using AlibabaCloud::OutboundBot::Model::InflightTaskTimeoutRequest;
InflightTaskTimeoutRequest::InflightTaskTimeoutRequest() :
RpcServiceRequest("outboundbot", "2019-12-26", "InflightTaskTimeout")
{
setMethod(HttpRequest::Method::Post);
}
InflightTaskTimeoutRequest::~InflightTaskTimeoutRequest()
{}
std::string InflightTaskTimeoutRequest::getInstanceId()const
{
return instanceId_;
}
void InflightTaskTimeoutRequest::setInstanceId(const std::string& instanceId)
{
instanceId_ = instanceId;
setParameter("InstanceId", instanceId);
}
long InflightTaskTimeoutRequest::getInstanceOwnerId()const
{
return instanceOwnerId_;
}
void InflightTaskTimeoutRequest::setInstanceOwnerId(long instanceOwnerId)
{
instanceOwnerId_ = instanceOwnerId;
setParameter("InstanceOwnerId", std::to_string(instanceOwnerId));
}
std::string InflightTaskTimeoutRequest::getTaskId()const
{
return taskId_;
}
void InflightTaskTimeoutRequest::setTaskId(const std::string& taskId)
{
taskId_ = taskId;
setParameter("TaskId", taskId);
}

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/outboundbot/model/InflightTaskTimeoutResult.h>
#include <json/json.h>
using namespace AlibabaCloud::OutboundBot;
using namespace AlibabaCloud::OutboundBot::Model;
InflightTaskTimeoutResult::InflightTaskTimeoutResult() :
ServiceResult()
{}
InflightTaskTimeoutResult::InflightTaskTimeoutResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
InflightTaskTimeoutResult::~InflightTaskTimeoutResult()
{}
void InflightTaskTimeoutResult::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["Code"].isNull())
code_ = value["Code"].asString();
if(!value["Message"].isNull())
message_ = value["Message"].asString();
if(!value["HttpStatusCode"].isNull())
httpStatusCode_ = std::stoi(value["HttpStatusCode"].asString());
}
std::string InflightTaskTimeoutResult::getMessage()const
{
return message_;
}
int InflightTaskTimeoutResult::getHttpStatusCode()const
{
return httpStatusCode_;
}
std::string InflightTaskTimeoutResult::getCode()const
{
return code_;
}
bool InflightTaskTimeoutResult::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/outboundbot/model/ListSchedulerInstancesRequest.h>
using AlibabaCloud::OutboundBot::Model::ListSchedulerInstancesRequest;
ListSchedulerInstancesRequest::ListSchedulerInstancesRequest() :
RpcServiceRequest("outboundbot", "2019-12-26", "ListSchedulerInstances")
{
setMethod(HttpRequest::Method::Post);
}
ListSchedulerInstancesRequest::~ListSchedulerInstancesRequest()
{}
long ListSchedulerInstancesRequest::getInstanceOwnerId()const
{
return instanceOwnerId_;
}
void ListSchedulerInstancesRequest::setInstanceOwnerId(long instanceOwnerId)
{
instanceOwnerId_ = instanceOwnerId;
setParameter("InstanceOwnerId", std::to_string(instanceOwnerId));
}

View File

@@ -0,0 +1,91 @@
/*
* 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/ListSchedulerInstancesResult.h>
#include <json/json.h>
using namespace AlibabaCloud::OutboundBot;
using namespace AlibabaCloud::OutboundBot::Model;
ListSchedulerInstancesResult::ListSchedulerInstancesResult() :
ServiceResult()
{}
ListSchedulerInstancesResult::ListSchedulerInstancesResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
ListSchedulerInstancesResult::~ListSchedulerInstancesResult()
{}
void ListSchedulerInstancesResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto allSchedulerInstancesNode = value["SchedulerInstances"]["SchedulerInstance"];
for (auto valueSchedulerInstancesSchedulerInstance : allSchedulerInstancesNode)
{
SchedulerInstance schedulerInstancesObject;
if(!valueSchedulerInstancesSchedulerInstance["OwnerId"].isNull())
schedulerInstancesObject.ownerId = valueSchedulerInstancesSchedulerInstance["OwnerId"].asString();
if(!valueSchedulerInstancesSchedulerInstance["InstanceId"].isNull())
schedulerInstancesObject.instanceId = valueSchedulerInstancesSchedulerInstance["InstanceId"].asString();
if(!valueSchedulerInstancesSchedulerInstance["Business"].isNull())
schedulerInstancesObject.business = valueSchedulerInstancesSchedulerInstance["Business"].asString();
if(!valueSchedulerInstancesSchedulerInstance["MaxConcurrency"].isNull())
schedulerInstancesObject.maxConcurrency = std::stoi(valueSchedulerInstancesSchedulerInstance["MaxConcurrency"].asString());
schedulerInstances_.push_back(schedulerInstancesObject);
}
if(!value["Success"].isNull())
success_ = value["Success"].asString() == "true";
if(!value["Code"].isNull())
code_ = value["Code"].asString();
if(!value["Message"].isNull())
message_ = value["Message"].asString();
if(!value["HttpStatusCode"].isNull())
httpStatusCode_ = std::stoi(value["HttpStatusCode"].asString());
}
std::vector<ListSchedulerInstancesResult::SchedulerInstance> ListSchedulerInstancesResult::getSchedulerInstances()const
{
return schedulerInstances_;
}
std::string ListSchedulerInstancesResult::getMessage()const
{
return message_;
}
int ListSchedulerInstancesResult::getHttpStatusCode()const
{
return httpStatusCode_;
}
std::string ListSchedulerInstancesResult::getCode()const
{
return code_;
}
bool ListSchedulerInstancesResult::getSuccess()const
{
return success_;
}

View File

@@ -0,0 +1,62 @@
/*
* 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/TaskPreparingRequest.h>
using AlibabaCloud::OutboundBot::Model::TaskPreparingRequest;
TaskPreparingRequest::TaskPreparingRequest() :
RpcServiceRequest("outboundbot", "2019-12-26", "TaskPreparing")
{
setMethod(HttpRequest::Method::Post);
}
TaskPreparingRequest::~TaskPreparingRequest()
{}
std::string TaskPreparingRequest::getJobId()const
{
return jobId_;
}
void TaskPreparingRequest::setJobId(const std::string& jobId)
{
jobId_ = jobId;
setParameter("JobId", jobId);
}
std::string TaskPreparingRequest::getInstanceId()const
{
return instanceId_;
}
void TaskPreparingRequest::setInstanceId(const std::string& instanceId)
{
instanceId_ = instanceId;
setParameter("InstanceId", instanceId);
}
long TaskPreparingRequest::getInstanceOwnerId()const
{
return instanceOwnerId_;
}
void TaskPreparingRequest::setInstanceOwnerId(long instanceOwnerId)
{
instanceOwnerId_ = instanceOwnerId;
setParameter("InstanceOwnerId", std::to_string(instanceOwnerId));
}

View File

@@ -0,0 +1,79 @@
/*
* 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/TaskPreparingResult.h>
#include <json/json.h>
using namespace AlibabaCloud::OutboundBot;
using namespace AlibabaCloud::OutboundBot::Model;
TaskPreparingResult::TaskPreparingResult() :
ServiceResult()
{}
TaskPreparingResult::TaskPreparingResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
TaskPreparingResult::~TaskPreparingResult()
{}
void TaskPreparingResult::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["Code"].isNull())
code_ = value["Code"].asString();
if(!value["Message"].isNull())
message_ = value["Message"].asString();
if(!value["HttpStatusCode"].isNull())
httpStatusCode_ = std::stoi(value["HttpStatusCode"].asString());
if(!value["TaskId"].isNull())
taskId_ = value["TaskId"].asString();
}
std::string TaskPreparingResult::getTaskId()const
{
return taskId_;
}
std::string TaskPreparingResult::getMessage()const
{
return message_;
}
int TaskPreparingResult::getHttpStatusCode()const
{
return httpStatusCode_;
}
std::string TaskPreparingResult::getCode()const
{
return code_;
}
bool TaskPreparingResult::getSuccess()const
{
return success_;
}