Add new API for recording.

This commit is contained in:
sdk-team
2021-01-12 12:26:02 +00:00
parent e699b34aee
commit f4ed9edc5e
12 changed files with 582 additions and 0 deletions

View File

@@ -1,3 +1,6 @@
2021-01-12 Version: patch
- Add new API for recording.
2021-01-11 Version: patch
- Create a new sdk.

View File

@@ -35,6 +35,10 @@ set(ccc_public_header_model
include/alibabacloud/ccc/model/CompleteAttendedTransferResult.h
include/alibabacloud/ccc/model/GetLoginDetailsRequest.h
include/alibabacloud/ccc/model/GetLoginDetailsResult.h
include/alibabacloud/ccc/model/GetMonoRecordingRequest.h
include/alibabacloud/ccc/model/GetMonoRecordingResult.h
include/alibabacloud/ccc/model/GetMultiChannelRecordingRequest.h
include/alibabacloud/ccc/model/GetMultiChannelRecordingResult.h
include/alibabacloud/ccc/model/GetNumberLocationRequest.h
include/alibabacloud/ccc/model/GetNumberLocationResult.h
include/alibabacloud/ccc/model/GetTurnCredentialsRequest.h
@@ -118,6 +122,10 @@ set(ccc_src
src/model/CompleteAttendedTransferResult.cc
src/model/GetLoginDetailsRequest.cc
src/model/GetLoginDetailsResult.cc
src/model/GetMonoRecordingRequest.cc
src/model/GetMonoRecordingResult.cc
src/model/GetMultiChannelRecordingRequest.cc
src/model/GetMultiChannelRecordingResult.cc
src/model/GetNumberLocationRequest.cc
src/model/GetNumberLocationResult.cc
src/model/GetTurnCredentialsRequest.cc

View File

@@ -36,6 +36,10 @@
#include "model/CompleteAttendedTransferResult.h"
#include "model/GetLoginDetailsRequest.h"
#include "model/GetLoginDetailsResult.h"
#include "model/GetMonoRecordingRequest.h"
#include "model/GetMonoRecordingResult.h"
#include "model/GetMultiChannelRecordingRequest.h"
#include "model/GetMultiChannelRecordingResult.h"
#include "model/GetNumberLocationRequest.h"
#include "model/GetNumberLocationResult.h"
#include "model/GetTurnCredentialsRequest.h"
@@ -132,6 +136,12 @@ namespace AlibabaCloud
typedef Outcome<Error, Model::GetLoginDetailsResult> GetLoginDetailsOutcome;
typedef std::future<GetLoginDetailsOutcome> GetLoginDetailsOutcomeCallable;
typedef std::function<void(const CCCClient*, const Model::GetLoginDetailsRequest&, const GetLoginDetailsOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetLoginDetailsAsyncHandler;
typedef Outcome<Error, Model::GetMonoRecordingResult> GetMonoRecordingOutcome;
typedef std::future<GetMonoRecordingOutcome> GetMonoRecordingOutcomeCallable;
typedef std::function<void(const CCCClient*, const Model::GetMonoRecordingRequest&, const GetMonoRecordingOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetMonoRecordingAsyncHandler;
typedef Outcome<Error, Model::GetMultiChannelRecordingResult> GetMultiChannelRecordingOutcome;
typedef std::future<GetMultiChannelRecordingOutcome> GetMultiChannelRecordingOutcomeCallable;
typedef std::function<void(const CCCClient*, const Model::GetMultiChannelRecordingRequest&, const GetMultiChannelRecordingOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetMultiChannelRecordingAsyncHandler;
typedef Outcome<Error, Model::GetNumberLocationResult> GetNumberLocationOutcome;
typedef std::future<GetNumberLocationOutcome> GetNumberLocationOutcomeCallable;
typedef std::function<void(const CCCClient*, const Model::GetNumberLocationRequest&, const GetNumberLocationOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetNumberLocationAsyncHandler;
@@ -257,6 +267,12 @@ namespace AlibabaCloud
GetLoginDetailsOutcome getLoginDetails(const Model::GetLoginDetailsRequest &request)const;
void getLoginDetailsAsync(const Model::GetLoginDetailsRequest& request, const GetLoginDetailsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
GetLoginDetailsOutcomeCallable getLoginDetailsCallable(const Model::GetLoginDetailsRequest& request) const;
GetMonoRecordingOutcome getMonoRecording(const Model::GetMonoRecordingRequest &request)const;
void getMonoRecordingAsync(const Model::GetMonoRecordingRequest& request, const GetMonoRecordingAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
GetMonoRecordingOutcomeCallable getMonoRecordingCallable(const Model::GetMonoRecordingRequest& request) const;
GetMultiChannelRecordingOutcome getMultiChannelRecording(const Model::GetMultiChannelRecordingRequest &request)const;
void getMultiChannelRecordingAsync(const Model::GetMultiChannelRecordingRequest& request, const GetMultiChannelRecordingAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
GetMultiChannelRecordingOutcomeCallable getMultiChannelRecordingCallable(const Model::GetMultiChannelRecordingRequest& request) const;
GetNumberLocationOutcome getNumberLocation(const Model::GetNumberLocationRequest &request)const;
void getNumberLocationAsync(const Model::GetNumberLocationRequest& request, const GetNumberLocationAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
GetNumberLocationOutcomeCallable getNumberLocationCallable(const Model::GetNumberLocationRequest& request) const;

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.
*/
#ifndef ALIBABACLOUD_CCC_MODEL_GETMONORECORDINGREQUEST_H_
#define ALIBABACLOUD_CCC_MODEL_GETMONORECORDINGREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/ccc/CCCExport.h>
namespace AlibabaCloud
{
namespace CCC
{
namespace Model
{
class ALIBABACLOUD_CCC_EXPORT GetMonoRecordingRequest : public RpcServiceRequest
{
public:
GetMonoRecordingRequest();
~GetMonoRecordingRequest();
std::string getContactId()const;
void setContactId(const std::string& contactId);
std::string getInstanceId()const;
void setInstanceId(const std::string& instanceId);
private:
std::string contactId_;
std::string instanceId_;
};
}
}
}
#endif // !ALIBABACLOUD_CCC_MODEL_GETMONORECORDINGREQUEST_H_

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.
*/
#ifndef ALIBABACLOUD_CCC_MODEL_GETMONORECORDINGRESULT_H_
#define ALIBABACLOUD_CCC_MODEL_GETMONORECORDINGRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/ccc/CCCExport.h>
namespace AlibabaCloud
{
namespace CCC
{
namespace Model
{
class ALIBABACLOUD_CCC_EXPORT GetMonoRecordingResult : public ServiceResult
{
public:
struct Data
{
std::string fileUrl;
std::string fileName;
};
GetMonoRecordingResult();
explicit GetMonoRecordingResult(const std::string &payload);
~GetMonoRecordingResult();
std::string getMessage()const;
int getHttpStatusCode()const;
Data getData()const;
std::string getCode()const;
protected:
void parse(const std::string &payload);
private:
std::string message_;
int httpStatusCode_;
Data data_;
std::string code_;
};
}
}
}
#endif // !ALIBABACLOUD_CCC_MODEL_GETMONORECORDINGRESULT_H_

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.
*/
#ifndef ALIBABACLOUD_CCC_MODEL_GETMULTICHANNELRECORDINGREQUEST_H_
#define ALIBABACLOUD_CCC_MODEL_GETMULTICHANNELRECORDINGREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/ccc/CCCExport.h>
namespace AlibabaCloud
{
namespace CCC
{
namespace Model
{
class ALIBABACLOUD_CCC_EXPORT GetMultiChannelRecordingRequest : public RpcServiceRequest
{
public:
GetMultiChannelRecordingRequest();
~GetMultiChannelRecordingRequest();
std::string getContactId()const;
void setContactId(const std::string& contactId);
std::string getInstanceId()const;
void setInstanceId(const std::string& instanceId);
private:
std::string contactId_;
std::string instanceId_;
};
}
}
}
#endif // !ALIBABACLOUD_CCC_MODEL_GETMULTICHANNELRECORDINGREQUEST_H_

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.
*/
#ifndef ALIBABACLOUD_CCC_MODEL_GETMULTICHANNELRECORDINGRESULT_H_
#define ALIBABACLOUD_CCC_MODEL_GETMULTICHANNELRECORDINGRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/ccc/CCCExport.h>
namespace AlibabaCloud
{
namespace CCC
{
namespace Model
{
class ALIBABACLOUD_CCC_EXPORT GetMultiChannelRecordingResult : public ServiceResult
{
public:
struct Recording
{
std::string fileUrl;
std::string fileName;
};
GetMultiChannelRecordingResult();
explicit GetMultiChannelRecordingResult(const std::string &payload);
~GetMultiChannelRecordingResult();
std::string getMessage()const;
int getHttpStatusCode()const;
std::vector<Recording> getData()const;
std::string getCode()const;
protected:
void parse(const std::string &payload);
private:
std::string message_;
int httpStatusCode_;
std::vector<Recording> data_;
std::string code_;
};
}
}
}
#endif // !ALIBABACLOUD_CCC_MODEL_GETMULTICHANNELRECORDINGRESULT_H_

View File

@@ -303,6 +303,78 @@ CCCClient::GetLoginDetailsOutcomeCallable CCCClient::getLoginDetailsCallable(con
return task->get_future();
}
CCCClient::GetMonoRecordingOutcome CCCClient::getMonoRecording(const GetMonoRecordingRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return GetMonoRecordingOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return GetMonoRecordingOutcome(GetMonoRecordingResult(outcome.result()));
else
return GetMonoRecordingOutcome(outcome.error());
}
void CCCClient::getMonoRecordingAsync(const GetMonoRecordingRequest& request, const GetMonoRecordingAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, getMonoRecording(request), context);
};
asyncExecute(new Runnable(fn));
}
CCCClient::GetMonoRecordingOutcomeCallable CCCClient::getMonoRecordingCallable(const GetMonoRecordingRequest &request) const
{
auto task = std::make_shared<std::packaged_task<GetMonoRecordingOutcome()>>(
[this, request]()
{
return this->getMonoRecording(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
CCCClient::GetMultiChannelRecordingOutcome CCCClient::getMultiChannelRecording(const GetMultiChannelRecordingRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return GetMultiChannelRecordingOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return GetMultiChannelRecordingOutcome(GetMultiChannelRecordingResult(outcome.result()));
else
return GetMultiChannelRecordingOutcome(outcome.error());
}
void CCCClient::getMultiChannelRecordingAsync(const GetMultiChannelRecordingRequest& request, const GetMultiChannelRecordingAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, getMultiChannelRecording(request), context);
};
asyncExecute(new Runnable(fn));
}
CCCClient::GetMultiChannelRecordingOutcomeCallable CCCClient::getMultiChannelRecordingCallable(const GetMultiChannelRecordingRequest &request) const
{
auto task = std::make_shared<std::packaged_task<GetMultiChannelRecordingOutcome()>>(
[this, request]()
{
return this->getMultiChannelRecording(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
CCCClient::GetNumberLocationOutcome CCCClient::getNumberLocation(const GetNumberLocationRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();

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/ccc/model/GetMonoRecordingRequest.h>
using AlibabaCloud::CCC::Model::GetMonoRecordingRequest;
GetMonoRecordingRequest::GetMonoRecordingRequest() :
RpcServiceRequest("ccc", "2020-07-01", "GetMonoRecording")
{
setMethod(HttpRequest::Method::Post);
}
GetMonoRecordingRequest::~GetMonoRecordingRequest()
{}
std::string GetMonoRecordingRequest::getContactId()const
{
return contactId_;
}
void GetMonoRecordingRequest::setContactId(const std::string& contactId)
{
contactId_ = contactId;
setParameter("ContactId", contactId);
}
std::string GetMonoRecordingRequest::getInstanceId()const
{
return instanceId_;
}
void GetMonoRecordingRequest::setInstanceId(const std::string& instanceId)
{
instanceId_ = instanceId;
setParameter("InstanceId", instanceId);
}

View File

@@ -0,0 +1,75 @@
/*
* 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/GetMonoRecordingResult.h>
#include <json/json.h>
using namespace AlibabaCloud::CCC;
using namespace AlibabaCloud::CCC::Model;
GetMonoRecordingResult::GetMonoRecordingResult() :
ServiceResult()
{}
GetMonoRecordingResult::GetMonoRecordingResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
GetMonoRecordingResult::~GetMonoRecordingResult()
{}
void GetMonoRecordingResult::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["FileName"].isNull())
data_.fileName = dataNode["FileName"].asString();
if(!dataNode["FileUrl"].isNull())
data_.fileUrl = dataNode["FileUrl"].asString();
if(!value["Code"].isNull())
code_ = value["Code"].asString();
if(!value["HttpStatusCode"].isNull())
httpStatusCode_ = std::stoi(value["HttpStatusCode"].asString());
if(!value["Message"].isNull())
message_ = value["Message"].asString();
}
std::string GetMonoRecordingResult::getMessage()const
{
return message_;
}
int GetMonoRecordingResult::getHttpStatusCode()const
{
return httpStatusCode_;
}
GetMonoRecordingResult::Data GetMonoRecordingResult::getData()const
{
return data_;
}
std::string GetMonoRecordingResult::getCode()const
{
return code_;
}

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/ccc/model/GetMultiChannelRecordingRequest.h>
using AlibabaCloud::CCC::Model::GetMultiChannelRecordingRequest;
GetMultiChannelRecordingRequest::GetMultiChannelRecordingRequest() :
RpcServiceRequest("ccc", "2020-07-01", "GetMultiChannelRecording")
{
setMethod(HttpRequest::Method::Post);
}
GetMultiChannelRecordingRequest::~GetMultiChannelRecordingRequest()
{}
std::string GetMultiChannelRecordingRequest::getContactId()const
{
return contactId_;
}
void GetMultiChannelRecordingRequest::setContactId(const std::string& contactId)
{
contactId_ = contactId;
setParameter("ContactId", contactId);
}
std::string GetMultiChannelRecordingRequest::getInstanceId()const
{
return instanceId_;
}
void GetMultiChannelRecordingRequest::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/ccc/model/GetMultiChannelRecordingResult.h>
#include <json/json.h>
using namespace AlibabaCloud::CCC;
using namespace AlibabaCloud::CCC::Model;
GetMultiChannelRecordingResult::GetMultiChannelRecordingResult() :
ServiceResult()
{}
GetMultiChannelRecordingResult::GetMultiChannelRecordingResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
GetMultiChannelRecordingResult::~GetMultiChannelRecordingResult()
{}
void GetMultiChannelRecordingResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto allDataNode = value["Data"]["Recording"];
for (auto valueDataRecording : allDataNode)
{
Recording dataObject;
if(!valueDataRecording["FileName"].isNull())
dataObject.fileName = valueDataRecording["FileName"].asString();
if(!valueDataRecording["FileUrl"].isNull())
dataObject.fileUrl = valueDataRecording["FileUrl"].asString();
data_.push_back(dataObject);
}
if(!value["Code"].isNull())
code_ = value["Code"].asString();
if(!value["HttpStatusCode"].isNull())
httpStatusCode_ = std::stoi(value["HttpStatusCode"].asString());
if(!value["Message"].isNull())
message_ = value["Message"].asString();
}
std::string GetMultiChannelRecordingResult::getMessage()const
{
return message_;
}
int GetMultiChannelRecordingResult::getHttpStatusCode()const
{
return httpStatusCode_;
}
std::vector<GetMultiChannelRecordingResult::Recording> GetMultiChannelRecordingResult::getData()const
{
return data_;
}
std::string GetMultiChannelRecordingResult::getCode()const
{
return code_;
}