Update Dyvmsapi SDK.

This commit is contained in:
sdk-team
2021-08-20 06:56:32 +00:00
parent 36828e0fce
commit 57e4665c5e
9 changed files with 325 additions and 1 deletions

View File

@@ -55,6 +55,8 @@ set(dyvmsapi_public_header_model
include/alibabacloud/dyvmsapi/model/DoubleCallSeatResult.h
include/alibabacloud/dyvmsapi/model/ExecuteCallTaskRequest.h
include/alibabacloud/dyvmsapi/model/ExecuteCallTaskResult.h
include/alibabacloud/dyvmsapi/model/GetCallInfoRequest.h
include/alibabacloud/dyvmsapi/model/GetCallInfoResult.h
include/alibabacloud/dyvmsapi/model/GetHotlineQualificationByOrderRequest.h
include/alibabacloud/dyvmsapi/model/GetHotlineQualificationByOrderResult.h
include/alibabacloud/dyvmsapi/model/GetRtcTokenRequest.h
@@ -174,6 +176,8 @@ set(dyvmsapi_src
src/model/DoubleCallSeatResult.cc
src/model/ExecuteCallTaskRequest.cc
src/model/ExecuteCallTaskResult.cc
src/model/GetCallInfoRequest.cc
src/model/GetCallInfoResult.cc
src/model/GetHotlineQualificationByOrderRequest.cc
src/model/GetHotlineQualificationByOrderResult.cc
src/model/GetRtcTokenRequest.cc

View File

@@ -56,6 +56,8 @@
#include "model/DoubleCallSeatResult.h"
#include "model/ExecuteCallTaskRequest.h"
#include "model/ExecuteCallTaskResult.h"
#include "model/GetCallInfoRequest.h"
#include "model/GetCallInfoResult.h"
#include "model/GetHotlineQualificationByOrderRequest.h"
#include "model/GetHotlineQualificationByOrderResult.h"
#include "model/GetRtcTokenRequest.h"
@@ -198,6 +200,9 @@ namespace AlibabaCloud
typedef Outcome<Error, Model::ExecuteCallTaskResult> ExecuteCallTaskOutcome;
typedef std::future<ExecuteCallTaskOutcome> ExecuteCallTaskOutcomeCallable;
typedef std::function<void(const DyvmsapiClient*, const Model::ExecuteCallTaskRequest&, const ExecuteCallTaskOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ExecuteCallTaskAsyncHandler;
typedef Outcome<Error, Model::GetCallInfoResult> GetCallInfoOutcome;
typedef std::future<GetCallInfoOutcome> GetCallInfoOutcomeCallable;
typedef std::function<void(const DyvmsapiClient*, const Model::GetCallInfoRequest&, const GetCallInfoOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetCallInfoAsyncHandler;
typedef Outcome<Error, Model::GetHotlineQualificationByOrderResult> GetHotlineQualificationByOrderOutcome;
typedef std::future<GetHotlineQualificationByOrderOutcome> GetHotlineQualificationByOrderOutcomeCallable;
typedef std::function<void(const DyvmsapiClient*, const Model::GetHotlineQualificationByOrderRequest&, const GetHotlineQualificationByOrderOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetHotlineQualificationByOrderAsyncHandler;
@@ -377,6 +382,9 @@ namespace AlibabaCloud
ExecuteCallTaskOutcome executeCallTask(const Model::ExecuteCallTaskRequest &request)const;
void executeCallTaskAsync(const Model::ExecuteCallTaskRequest& request, const ExecuteCallTaskAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
ExecuteCallTaskOutcomeCallable executeCallTaskCallable(const Model::ExecuteCallTaskRequest& request) const;
GetCallInfoOutcome getCallInfo(const Model::GetCallInfoRequest &request)const;
void getCallInfoAsync(const Model::GetCallInfoRequest& request, const GetCallInfoAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
GetCallInfoOutcomeCallable getCallInfoCallable(const Model::GetCallInfoRequest& request) const;
GetHotlineQualificationByOrderOutcome getHotlineQualificationByOrder(const Model::GetHotlineQualificationByOrderRequest &request)const;
void getHotlineQualificationByOrderAsync(const Model::GetHotlineQualificationByOrderRequest& request, const GetHotlineQualificationByOrderAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
GetHotlineQualificationByOrderOutcomeCallable getHotlineQualificationByOrderCallable(const Model::GetHotlineQualificationByOrderRequest& request) const;

View File

@@ -0,0 +1,60 @@
/*
* 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.
*/
#ifndef ALIBABACLOUD_DYVMSAPI_MODEL_GETCALLINFOREQUEST_H_
#define ALIBABACLOUD_DYVMSAPI_MODEL_GETCALLINFOREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/dyvmsapi/DyvmsapiExport.h>
namespace AlibabaCloud
{
namespace Dyvmsapi
{
namespace Model
{
class ALIBABACLOUD_DYVMSAPI_EXPORT GetCallInfoRequest : public RpcServiceRequest
{
public:
GetCallInfoRequest();
~GetCallInfoRequest();
std::string getRtcId()const;
void setRtcId(const std::string& rtcId);
long getResourceOwnerId()const;
void setResourceOwnerId(long resourceOwnerId);
std::string getAccessKeyId()const;
void setAccessKeyId(const std::string& accessKeyId);
std::string getResourceOwnerAccount()const;
void setResourceOwnerAccount(const std::string& resourceOwnerAccount);
long getOwnerId()const;
void setOwnerId(long ownerId);
private:
std::string rtcId_;
long resourceOwnerId_;
std::string accessKeyId_;
std::string resourceOwnerAccount_;
long ownerId_;
};
}
}
}
#endif // !ALIBABACLOUD_DYVMSAPI_MODEL_GETCALLINFOREQUEST_H_

View File

@@ -0,0 +1,60 @@
/*
* 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.
*/
#ifndef ALIBABACLOUD_DYVMSAPI_MODEL_GETCALLINFORESULT_H_
#define ALIBABACLOUD_DYVMSAPI_MODEL_GETCALLINFORESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/dyvmsapi/DyvmsapiExport.h>
namespace AlibabaCloud
{
namespace Dyvmsapi
{
namespace Model
{
class ALIBABACLOUD_DYVMSAPI_EXPORT GetCallInfoResult : public ServiceResult
{
public:
struct Data
{
std::string status;
std::string channelId;
};
GetCallInfoResult();
explicit GetCallInfoResult(const std::string &payload);
~GetCallInfoResult();
std::string getMessage()const;
Data getData()const;
std::string getCode()const;
protected:
void parse(const std::string &payload);
private:
std::string message_;
Data data_;
std::string code_;
};
}
}
}
#endif // !ALIBABACLOUD_DYVMSAPI_MODEL_GETCALLINFORESULT_H_

View File

@@ -663,6 +663,42 @@ DyvmsapiClient::ExecuteCallTaskOutcomeCallable DyvmsapiClient::executeCallTaskCa
return task->get_future();
}
DyvmsapiClient::GetCallInfoOutcome DyvmsapiClient::getCallInfo(const GetCallInfoRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return GetCallInfoOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return GetCallInfoOutcome(GetCallInfoResult(outcome.result()));
else
return GetCallInfoOutcome(outcome.error());
}
void DyvmsapiClient::getCallInfoAsync(const GetCallInfoRequest& request, const GetCallInfoAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, getCallInfo(request), context);
};
asyncExecute(new Runnable(fn));
}
DyvmsapiClient::GetCallInfoOutcomeCallable DyvmsapiClient::getCallInfoCallable(const GetCallInfoRequest &request) const
{
auto task = std::make_shared<std::packaged_task<GetCallInfoOutcome()>>(
[this, request]()
{
return this->getCallInfo(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
DyvmsapiClient::GetHotlineQualificationByOrderOutcome DyvmsapiClient::getHotlineQualificationByOrder(const GetHotlineQualificationByOrderRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();

View File

@@ -0,0 +1,84 @@
/*
* 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/dyvmsapi/model/GetCallInfoRequest.h>
using AlibabaCloud::Dyvmsapi::Model::GetCallInfoRequest;
GetCallInfoRequest::GetCallInfoRequest() :
RpcServiceRequest("dyvmsapi", "2017-05-25", "GetCallInfo")
{
setMethod(HttpRequest::Method::Post);
}
GetCallInfoRequest::~GetCallInfoRequest()
{}
std::string GetCallInfoRequest::getRtcId()const
{
return rtcId_;
}
void GetCallInfoRequest::setRtcId(const std::string& rtcId)
{
rtcId_ = rtcId;
setParameter("RtcId", rtcId);
}
long GetCallInfoRequest::getResourceOwnerId()const
{
return resourceOwnerId_;
}
void GetCallInfoRequest::setResourceOwnerId(long resourceOwnerId)
{
resourceOwnerId_ = resourceOwnerId;
setParameter("ResourceOwnerId", std::to_string(resourceOwnerId));
}
std::string GetCallInfoRequest::getAccessKeyId()const
{
return accessKeyId_;
}
void GetCallInfoRequest::setAccessKeyId(const std::string& accessKeyId)
{
accessKeyId_ = accessKeyId;
setParameter("AccessKeyId", accessKeyId);
}
std::string GetCallInfoRequest::getResourceOwnerAccount()const
{
return resourceOwnerAccount_;
}
void GetCallInfoRequest::setResourceOwnerAccount(const std::string& resourceOwnerAccount)
{
resourceOwnerAccount_ = resourceOwnerAccount;
setParameter("ResourceOwnerAccount", resourceOwnerAccount);
}
long GetCallInfoRequest::getOwnerId()const
{
return ownerId_;
}
void GetCallInfoRequest::setOwnerId(long ownerId)
{
ownerId_ = ownerId;
setParameter("OwnerId", std::to_string(ownerId));
}

View File

@@ -0,0 +1,68 @@
/*
* 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/dyvmsapi/model/GetCallInfoResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Dyvmsapi;
using namespace AlibabaCloud::Dyvmsapi::Model;
GetCallInfoResult::GetCallInfoResult() :
ServiceResult()
{}
GetCallInfoResult::GetCallInfoResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
GetCallInfoResult::~GetCallInfoResult()
{}
void GetCallInfoResult::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["ChannelId"].isNull())
data_.channelId = dataNode["ChannelId"].asString();
if(!dataNode["Status"].isNull())
data_.status = dataNode["Status"].asString();
if(!value["Code"].isNull())
code_ = value["Code"].asString();
if(!value["Message"].isNull())
message_ = value["Message"].asString();
}
std::string GetCallInfoResult::getMessage()const
{
return message_;
}
GetCallInfoResult::Data GetCallInfoResult::getData()const
{
return data_;
}
std::string GetCallInfoResult::getCode()const
{
return code_;
}