Export new API for predictive dialer.

This commit is contained in:
sdk-team
2021-03-19 06:47:12 +00:00
parent edf8a946ea
commit 5b50c4167b
9 changed files with 327 additions and 1 deletions

View File

@@ -159,6 +159,42 @@ CCCClient::AddBulkPhoneNumbersOutcomeCallable CCCClient::addBulkPhoneNumbersCall
return task->get_future();
}
CCCClient::AddJobsToPredictiveJobGroupOutcome CCCClient::addJobsToPredictiveJobGroup(const AddJobsToPredictiveJobGroupRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return AddJobsToPredictiveJobGroupOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return AddJobsToPredictiveJobGroupOutcome(AddJobsToPredictiveJobGroupResult(outcome.result()));
else
return AddJobsToPredictiveJobGroupOutcome(outcome.error());
}
void CCCClient::addJobsToPredictiveJobGroupAsync(const AddJobsToPredictiveJobGroupRequest& request, const AddJobsToPredictiveJobGroupAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, addJobsToPredictiveJobGroup(request), context);
};
asyncExecute(new Runnable(fn));
}
CCCClient::AddJobsToPredictiveJobGroupOutcomeCallable CCCClient::addJobsToPredictiveJobGroupCallable(const AddJobsToPredictiveJobGroupRequest &request) const
{
auto task = std::make_shared<std::packaged_task<AddJobsToPredictiveJobGroupOutcome()>>(
[this, request]()
{
return this->addJobsToPredictiveJobGroup(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
CCCClient::AddPhoneNumberOutcome CCCClient::addPhoneNumber(const AddPhoneNumberRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();

View File

@@ -0,0 +1,86 @@
/*
* 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/ccc/model/AddJobsToPredictiveJobGroupRequest.h>
using AlibabaCloud::CCC::Model::AddJobsToPredictiveJobGroupRequest;
AddJobsToPredictiveJobGroupRequest::AddJobsToPredictiveJobGroupRequest() :
RpcServiceRequest("ccc", "2017-07-05", "AddJobsToPredictiveJobGroup")
{
setMethod(HttpRequest::Method::Post);
}
AddJobsToPredictiveJobGroupRequest::~AddJobsToPredictiveJobGroupRequest()
{}
std::string AddJobsToPredictiveJobGroupRequest::getClientToken()const
{
return clientToken_;
}
void AddJobsToPredictiveJobGroupRequest::setClientToken(const std::string& clientToken)
{
clientToken_ = clientToken;
setParameter("ClientToken", clientToken);
}
std::vector<std::string> AddJobsToPredictiveJobGroupRequest::getJobsJson()const
{
return jobsJson_;
}
void AddJobsToPredictiveJobGroupRequest::setJobsJson(const std::vector<std::string>& jobsJson)
{
jobsJson_ = jobsJson;
for(int dep1 = 0; dep1!= jobsJson.size(); dep1++) {
setBodyParameter("JobsJson."+ std::to_string(dep1), jobsJson.at(dep1));
}
}
std::string AddJobsToPredictiveJobGroupRequest::getInstanceId()const
{
return instanceId_;
}
void AddJobsToPredictiveJobGroupRequest::setInstanceId(const std::string& instanceId)
{
instanceId_ = instanceId;
setParameter("InstanceId", instanceId);
}
std::string AddJobsToPredictiveJobGroupRequest::getSkillGroupId()const
{
return skillGroupId_;
}
void AddJobsToPredictiveJobGroupRequest::setSkillGroupId(const std::string& skillGroupId)
{
skillGroupId_ = skillGroupId;
setParameter("SkillGroupId", skillGroupId);
}
std::string AddJobsToPredictiveJobGroupRequest::getJobGroupId()const
{
return jobGroupId_;
}
void AddJobsToPredictiveJobGroupRequest::setJobGroupId(const std::string& jobGroupId)
{
jobGroupId_ = jobGroupId;
setParameter("JobGroupId", jobGroupId);
}

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/ccc/model/AddJobsToPredictiveJobGroupResult.h>
#include <json/json.h>
using namespace AlibabaCloud::CCC;
using namespace AlibabaCloud::CCC::Model;
AddJobsToPredictiveJobGroupResult::AddJobsToPredictiveJobGroupResult() :
ServiceResult()
{}
AddJobsToPredictiveJobGroupResult::AddJobsToPredictiveJobGroupResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
AddJobsToPredictiveJobGroupResult::~AddJobsToPredictiveJobGroupResult()
{}
void AddJobsToPredictiveJobGroupResult::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 AddJobsToPredictiveJobGroupResult::getMessage()const
{
return message_;
}
int AddJobsToPredictiveJobGroupResult::getHttpStatusCode()const
{
return httpStatusCode_;
}
std::string AddJobsToPredictiveJobGroupResult::getCode()const
{
return code_;
}
bool AddJobsToPredictiveJobGroupResult::getSuccess()const
{
return success_;
}