diff --git a/CHANGELOG b/CHANGELOG index 4760d01e8..9bc028adb 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2021-01-12 Version: patch +- Add new API for recording. + 2021-01-11 Version: patch - Create a new sdk. diff --git a/ccc/CMakeLists.txt b/ccc/CMakeLists.txt index b960af8a1..9006689c2 100644 --- a/ccc/CMakeLists.txt +++ b/ccc/CMakeLists.txt @@ -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 diff --git a/ccc/include/alibabacloud/ccc/CCCClient.h b/ccc/include/alibabacloud/ccc/CCCClient.h index edc2015b5..54ee2f30b 100644 --- a/ccc/include/alibabacloud/ccc/CCCClient.h +++ b/ccc/include/alibabacloud/ccc/CCCClient.h @@ -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 GetLoginDetailsOutcome; typedef std::future GetLoginDetailsOutcomeCallable; typedef std::function&)> GetLoginDetailsAsyncHandler; + typedef Outcome GetMonoRecordingOutcome; + typedef std::future GetMonoRecordingOutcomeCallable; + typedef std::function&)> GetMonoRecordingAsyncHandler; + typedef Outcome GetMultiChannelRecordingOutcome; + typedef std::future GetMultiChannelRecordingOutcomeCallable; + typedef std::function&)> GetMultiChannelRecordingAsyncHandler; typedef Outcome GetNumberLocationOutcome; typedef std::future GetNumberLocationOutcomeCallable; typedef std::function&)> 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& 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& 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& 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& context = nullptr) const; GetNumberLocationOutcomeCallable getNumberLocationCallable(const Model::GetNumberLocationRequest& request) const; diff --git a/ccc/include/alibabacloud/ccc/model/GetMonoRecordingRequest.h b/ccc/include/alibabacloud/ccc/model/GetMonoRecordingRequest.h new file mode 100644 index 000000000..7a9ed8647 --- /dev/null +++ b/ccc/include/alibabacloud/ccc/model/GetMonoRecordingRequest.h @@ -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 +#include +#include +#include + +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_ \ No newline at end of file diff --git a/ccc/include/alibabacloud/ccc/model/GetMonoRecordingResult.h b/ccc/include/alibabacloud/ccc/model/GetMonoRecordingResult.h new file mode 100644 index 000000000..0925f0ca5 --- /dev/null +++ b/ccc/include/alibabacloud/ccc/model/GetMonoRecordingResult.h @@ -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 +#include +#include +#include +#include + +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_ \ No newline at end of file diff --git a/ccc/include/alibabacloud/ccc/model/GetMultiChannelRecordingRequest.h b/ccc/include/alibabacloud/ccc/model/GetMultiChannelRecordingRequest.h new file mode 100644 index 000000000..11dd4fde5 --- /dev/null +++ b/ccc/include/alibabacloud/ccc/model/GetMultiChannelRecordingRequest.h @@ -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 +#include +#include +#include + +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_ \ No newline at end of file diff --git a/ccc/include/alibabacloud/ccc/model/GetMultiChannelRecordingResult.h b/ccc/include/alibabacloud/ccc/model/GetMultiChannelRecordingResult.h new file mode 100644 index 000000000..5e0f8bb98 --- /dev/null +++ b/ccc/include/alibabacloud/ccc/model/GetMultiChannelRecordingResult.h @@ -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 +#include +#include +#include +#include + +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 getData()const; + std::string getCode()const; + + protected: + void parse(const std::string &payload); + private: + std::string message_; + int httpStatusCode_; + std::vector data_; + std::string code_; + + }; + } + } +} +#endif // !ALIBABACLOUD_CCC_MODEL_GETMULTICHANNELRECORDINGRESULT_H_ \ No newline at end of file diff --git a/ccc/src/CCCClient.cc b/ccc/src/CCCClient.cc index 0309f1cb1..7f012a404 100644 --- a/ccc/src/CCCClient.cc +++ b/ccc/src/CCCClient.cc @@ -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& 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>( + [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& 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>( + [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(); diff --git a/ccc/src/model/GetMonoRecordingRequest.cc b/ccc/src/model/GetMonoRecordingRequest.cc new file mode 100644 index 000000000..acc727b09 --- /dev/null +++ b/ccc/src/model/GetMonoRecordingRequest.cc @@ -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 + +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); +} + diff --git a/ccc/src/model/GetMonoRecordingResult.cc b/ccc/src/model/GetMonoRecordingResult.cc new file mode 100644 index 000000000..b5438ecee --- /dev/null +++ b/ccc/src/model/GetMonoRecordingResult.cc @@ -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 +#include + +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_; +} + diff --git a/ccc/src/model/GetMultiChannelRecordingRequest.cc b/ccc/src/model/GetMultiChannelRecordingRequest.cc new file mode 100644 index 000000000..f1a6d615a --- /dev/null +++ b/ccc/src/model/GetMultiChannelRecordingRequest.cc @@ -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 + +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); +} + diff --git a/ccc/src/model/GetMultiChannelRecordingResult.cc b/ccc/src/model/GetMultiChannelRecordingResult.cc new file mode 100644 index 000000000..444d9827c --- /dev/null +++ b/ccc/src/model/GetMultiChannelRecordingResult.cc @@ -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 +#include + +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::getData()const +{ + return data_; +} + +std::string GetMultiChannelRecordingResult::getCode()const +{ + return code_; +} +