diff --git a/VERSION b/VERSION index df55ef51b..b208568f2 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.1250 \ No newline at end of file +1.36.1251 \ No newline at end of file diff --git a/smartsales/CMakeLists.txt b/smartsales/CMakeLists.txt new file mode 100644 index 000000000..72b1473a6 --- /dev/null +++ b/smartsales/CMakeLists.txt @@ -0,0 +1,90 @@ +# +# 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. +# + +set(public_header_dir ${CMAKE_CURRENT_SOURCE_DIR}/../include) + +set(smartsales_public_header + include/alibabacloud/smartsales/SmartSalesClient.h + include/alibabacloud/smartsales/SmartSalesExport.h ) + +set(smartsales_public_header_model + include/alibabacloud/smartsales/model/UpdateCallRequest.h + include/alibabacloud/smartsales/model/UpdateCallResult.h + include/alibabacloud/smartsales/model/UploadVoiceDataRequest.h + include/alibabacloud/smartsales/model/UploadVoiceDataResult.h ) + +set(smartsales_src + src/SmartSalesClient.cc + src/model/UpdateCallRequest.cc + src/model/UpdateCallResult.cc + src/model/UploadVoiceDataRequest.cc + src/model/UploadVoiceDataResult.cc ) + +add_library(smartsales ${LIB_TYPE} + ${smartsales_public_header} + ${smartsales_public_header_model} + ${smartsales_src}) + +set_target_properties(smartsales + PROPERTIES + LINKER_LANGUAGE CXX + ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin + OUTPUT_NAME ${TARGET_OUTPUT_NAME_PREFIX}smartsales + ) + +if(${LIB_TYPE} STREQUAL "SHARED") + set_target_properties(smartsales + PROPERTIES + DEFINE_SYMBOL ALIBABACLOUD_SMARTSALES_LIBRARY) +endif() + +target_include_directories(smartsales + PRIVATE include + ${CMAKE_SOURCE_DIR}/core/include + ) +target_link_libraries(smartsales + core) + +if(CMAKE_HOST_WIN32) + ExternalProject_Get_Property(jsoncpp INSTALL_DIR) + set(jsoncpp_install_dir ${INSTALL_DIR}) + add_dependencies(smartsales + jsoncpp) + target_include_directories(smartsales + PRIVATE ${jsoncpp_install_dir}/include) + target_link_libraries(smartsales + ${jsoncpp_install_dir}/lib/jsoncpp.lib) + set_target_properties(smartsales + PROPERTIES + COMPILE_OPTIONS "/bigobj") +else() + target_include_directories(smartsales + PRIVATE /usr/include/jsoncpp) + target_link_libraries(smartsales + jsoncpp) +endif() + +install(FILES ${smartsales_public_header} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/smartsales) +install(FILES ${smartsales_public_header_model} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/smartsales/model) +install(TARGETS smartsales + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ) \ No newline at end of file diff --git a/smartsales/include/alibabacloud/smartsales/SmartSalesClient.h b/smartsales/include/alibabacloud/smartsales/SmartSalesClient.h new file mode 100644 index 000000000..a57df5920 --- /dev/null +++ b/smartsales/include/alibabacloud/smartsales/SmartSalesClient.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_SMARTSALES_SMARTSALESCLIENT_H_ +#define ALIBABACLOUD_SMARTSALES_SMARTSALESCLIENT_H_ + +#include +#include +#include +#include +#include "SmartSalesExport.h" +#include "model/UpdateCallRequest.h" +#include "model/UpdateCallResult.h" +#include "model/UploadVoiceDataRequest.h" +#include "model/UploadVoiceDataResult.h" + + +namespace AlibabaCloud +{ + namespace SmartSales + { + class ALIBABACLOUD_SMARTSALES_EXPORT SmartSalesClient : public RpcServiceClient + { + public: + typedef Outcome UpdateCallOutcome; + typedef std::future UpdateCallOutcomeCallable; + typedef std::function&)> UpdateCallAsyncHandler; + typedef Outcome UploadVoiceDataOutcome; + typedef std::future UploadVoiceDataOutcomeCallable; + typedef std::function&)> UploadVoiceDataAsyncHandler; + + SmartSalesClient(const Credentials &credentials, const ClientConfiguration &configuration); + SmartSalesClient(const std::shared_ptr &credentialsProvider, const ClientConfiguration &configuration); + SmartSalesClient(const std::string &accessKeyId, const std::string &accessKeySecret, const ClientConfiguration &configuration); + ~SmartSalesClient(); + UpdateCallOutcome updateCall(const Model::UpdateCallRequest &request)const; + void updateCallAsync(const Model::UpdateCallRequest& request, const UpdateCallAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + UpdateCallOutcomeCallable updateCallCallable(const Model::UpdateCallRequest& request) const; + UploadVoiceDataOutcome uploadVoiceData(const Model::UploadVoiceDataRequest &request)const; + void uploadVoiceDataAsync(const Model::UploadVoiceDataRequest& request, const UploadVoiceDataAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + UploadVoiceDataOutcomeCallable uploadVoiceDataCallable(const Model::UploadVoiceDataRequest& request) const; + + private: + std::shared_ptr endpointProvider_; + }; + } +} + +#endif // !ALIBABACLOUD_SMARTSALES_SMARTSALESCLIENT_H_ diff --git a/smartsales/include/alibabacloud/smartsales/SmartSalesExport.h b/smartsales/include/alibabacloud/smartsales/SmartSalesExport.h new file mode 100644 index 000000000..b1c5a826f --- /dev/null +++ b/smartsales/include/alibabacloud/smartsales/SmartSalesExport.h @@ -0,0 +1,32 @@ +/* + * 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_SMARTSALES_SMARTSALESEXPORT_H_ +#define ALIBABACLOUD_SMARTSALES_SMARTSALESEXPORT_H_ + +#include + +#if defined(ALIBABACLOUD_SHARED) +# if defined(ALIBABACLOUD_SMARTSALES_LIBRARY) +# define ALIBABACLOUD_SMARTSALES_EXPORT ALIBABACLOUD_DECL_EXPORT +# else +# define ALIBABACLOUD_SMARTSALES_EXPORT ALIBABACLOUD_DECL_IMPORT +# endif +#else +# define ALIBABACLOUD_SMARTSALES_EXPORT +#endif + +#endif // !ALIBABACLOUD_SMARTSALES_SMARTSALESEXPORT_H_ \ No newline at end of file diff --git a/smartsales/include/alibabacloud/smartsales/model/UpdateCallRequest.h b/smartsales/include/alibabacloud/smartsales/model/UpdateCallRequest.h new file mode 100644 index 000000000..eac16b324 --- /dev/null +++ b/smartsales/include/alibabacloud/smartsales/model/UpdateCallRequest.h @@ -0,0 +1,57 @@ +/* + * 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_SMARTSALES_MODEL_UPDATECALLREQUEST_H_ +#define ALIBABACLOUD_SMARTSALES_MODEL_UPDATECALLREQUEST_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud { +namespace SmartSales { +namespace Model { +class ALIBABACLOUD_SMARTSALES_EXPORT UpdateCallRequest : public RpcServiceRequest { +public: + UpdateCallRequest(); + ~UpdateCallRequest(); + long getCallId() const; + void setCallId(long callId); + std::string getClueStatusRemark() const; + void setClueStatusRemark(const std::string &clueStatusRemark); + std::string getAgentKey() const; + void setAgentKey(const std::string &agentKey); + int getBusinessResult() const; + void setBusinessResult(int businessResult); + std::string getAccessKeyId() const; + void setAccessKeyId(const std::string &accessKeyId); + std::string getCustomCallId() const; + void setCustomCallId(const std::string &customCallId); + +private: + long callId_; + std::string clueStatusRemark_; + std::string agentKey_; + int businessResult_; + std::string accessKeyId_; + std::string customCallId_; +}; +} // namespace Model +} // namespace SmartSales +} // namespace AlibabaCloud +#endif // !ALIBABACLOUD_SMARTSALES_MODEL_UPDATECALLREQUEST_H_ diff --git a/smartsales/include/alibabacloud/smartsales/model/UpdateCallResult.h b/smartsales/include/alibabacloud/smartsales/model/UpdateCallResult.h new file mode 100644 index 000000000..79a74a441 --- /dev/null +++ b/smartsales/include/alibabacloud/smartsales/model/UpdateCallResult.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_SMARTSALES_MODEL_UPDATECALLRESULT_H_ +#define ALIBABACLOUD_SMARTSALES_MODEL_UPDATECALLRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace SmartSales + { + namespace Model + { + class ALIBABACLOUD_SMARTSALES_EXPORT UpdateCallResult : public ServiceResult + { + public: + + + UpdateCallResult(); + explicit UpdateCallResult(const std::string &payload); + ~UpdateCallResult(); + std::string getSuccess()const; + + protected: + void parse(const std::string &payload); + private: + std::string success_; + + }; + } + } +} +#endif // !ALIBABACLOUD_SMARTSALES_MODEL_UPDATECALLRESULT_H_ \ No newline at end of file diff --git a/smartsales/include/alibabacloud/smartsales/model/UploadVoiceDataRequest.h b/smartsales/include/alibabacloud/smartsales/model/UploadVoiceDataRequest.h new file mode 100644 index 000000000..35e81633a --- /dev/null +++ b/smartsales/include/alibabacloud/smartsales/model/UploadVoiceDataRequest.h @@ -0,0 +1,66 @@ +/* + * 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_SMARTSALES_MODEL_UPLOADVOICEDATAREQUEST_H_ +#define ALIBABACLOUD_SMARTSALES_MODEL_UPLOADVOICEDATAREQUEST_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud { +namespace SmartSales { +namespace Model { +class ALIBABACLOUD_SMARTSALES_EXPORT UploadVoiceDataRequest : public RpcServiceRequest { +public: + struct VoiceDataList { + std::string customParamJson; + std::string clueStatusRemark; + long beginTime; + int callChannel; + int businessResult; + std::string customCallId; + long salesPersonId; + long teamId; + std::string customerId; + std::string fileUrl; + int clientTrackNumber; + std::string customerName; + int callType; + std::string calleeNumber; + std::string salesPersonName; + std::string callerNumber; + }; + UploadVoiceDataRequest(); + ~UploadVoiceDataRequest(); + std::string getAgentKey() const; + void setAgentKey(const std::string &agentKey); + std::string getAccessKeyId() const; + void setAccessKeyId(const std::string &accessKeyId); + std::vector getVoiceDataList() const; + void setVoiceDataList(const std::vector &voiceDataList); + +private: + std::string agentKey_; + std::string accessKeyId_; + std::vector voiceDataList_; +}; +} // namespace Model +} // namespace SmartSales +} // namespace AlibabaCloud +#endif // !ALIBABACLOUD_SMARTSALES_MODEL_UPLOADVOICEDATAREQUEST_H_ diff --git a/smartsales/include/alibabacloud/smartsales/model/UploadVoiceDataResult.h b/smartsales/include/alibabacloud/smartsales/model/UploadVoiceDataResult.h new file mode 100644 index 000000000..882cd6d58 --- /dev/null +++ b/smartsales/include/alibabacloud/smartsales/model/UploadVoiceDataResult.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_SMARTSALES_MODEL_UPLOADVOICEDATARESULT_H_ +#define ALIBABACLOUD_SMARTSALES_MODEL_UPLOADVOICEDATARESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace SmartSales + { + namespace Model + { + class ALIBABACLOUD_SMARTSALES_EXPORT UploadVoiceDataResult : public ServiceResult + { + public: + + + UploadVoiceDataResult(); + explicit UploadVoiceDataResult(const std::string &payload); + ~UploadVoiceDataResult(); + std::string getJobId()const; + + protected: + void parse(const std::string &payload); + private: + std::string jobId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_SMARTSALES_MODEL_UPLOADVOICEDATARESULT_H_ \ No newline at end of file diff --git a/smartsales/src/SmartSalesClient.cc b/smartsales/src/SmartSalesClient.cc new file mode 100644 index 000000000..2a16d4bf0 --- /dev/null +++ b/smartsales/src/SmartSalesClient.cc @@ -0,0 +1,125 @@ +/* + * 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; +using namespace AlibabaCloud::Location; +using namespace AlibabaCloud::SmartSales; +using namespace AlibabaCloud::SmartSales::Model; + +namespace +{ + const std::string SERVICE_NAME = "SmartSales"; +} + +SmartSalesClient::SmartSalesClient(const Credentials &credentials, const ClientConfiguration &configuration) : + RpcServiceClient(SERVICE_NAME, std::make_shared(credentials), configuration) +{ + auto locationClient = std::make_shared(credentials, configuration); + endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, ""); +} + +SmartSalesClient::SmartSalesClient(const std::shared_ptr& credentialsProvider, const ClientConfiguration & configuration) : + RpcServiceClient(SERVICE_NAME, credentialsProvider, configuration) +{ + auto locationClient = std::make_shared(credentialsProvider, configuration); + endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, ""); +} + +SmartSalesClient::SmartSalesClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) : + RpcServiceClient(SERVICE_NAME, std::make_shared(accessKeyId, accessKeySecret), configuration) +{ + auto locationClient = std::make_shared(accessKeyId, accessKeySecret, configuration); + endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, ""); +} + +SmartSalesClient::~SmartSalesClient() +{} + +SmartSalesClient::UpdateCallOutcome SmartSalesClient::updateCall(const UpdateCallRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return UpdateCallOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return UpdateCallOutcome(UpdateCallResult(outcome.result())); + else + return UpdateCallOutcome(outcome.error()); +} + +void SmartSalesClient::updateCallAsync(const UpdateCallRequest& request, const UpdateCallAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, updateCall(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +SmartSalesClient::UpdateCallOutcomeCallable SmartSalesClient::updateCallCallable(const UpdateCallRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->updateCall(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +SmartSalesClient::UploadVoiceDataOutcome SmartSalesClient::uploadVoiceData(const UploadVoiceDataRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return UploadVoiceDataOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return UploadVoiceDataOutcome(UploadVoiceDataResult(outcome.result())); + else + return UploadVoiceDataOutcome(outcome.error()); +} + +void SmartSalesClient::uploadVoiceDataAsync(const UploadVoiceDataRequest& request, const UploadVoiceDataAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, uploadVoiceData(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +SmartSalesClient::UploadVoiceDataOutcomeCallable SmartSalesClient::uploadVoiceDataCallable(const UploadVoiceDataRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->uploadVoiceData(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + diff --git a/smartsales/src/model/UpdateCallRequest.cc b/smartsales/src/model/UpdateCallRequest.cc new file mode 100644 index 000000000..b63fd49c1 --- /dev/null +++ b/smartsales/src/model/UpdateCallRequest.cc @@ -0,0 +1,81 @@ +/* + * 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::SmartSales::Model::UpdateCallRequest; + +UpdateCallRequest::UpdateCallRequest() + : RpcServiceRequest("smartsales", "2022-08-18", "UpdateCall") { + setMethod(HttpRequest::Method::Post); +} + +UpdateCallRequest::~UpdateCallRequest() {} + +long UpdateCallRequest::getCallId() const { + return callId_; +} + +void UpdateCallRequest::setCallId(long callId) { + callId_ = callId; + setParameter(std::string("CallId"), std::to_string(callId)); +} + +std::string UpdateCallRequest::getClueStatusRemark() const { + return clueStatusRemark_; +} + +void UpdateCallRequest::setClueStatusRemark(const std::string &clueStatusRemark) { + clueStatusRemark_ = clueStatusRemark; + setParameter(std::string("ClueStatusRemark"), clueStatusRemark); +} + +std::string UpdateCallRequest::getAgentKey() const { + return agentKey_; +} + +void UpdateCallRequest::setAgentKey(const std::string &agentKey) { + agentKey_ = agentKey; + setParameter(std::string("AgentKey"), agentKey); +} + +int UpdateCallRequest::getBusinessResult() const { + return businessResult_; +} + +void UpdateCallRequest::setBusinessResult(int businessResult) { + businessResult_ = businessResult; + setParameter(std::string("BusinessResult"), std::to_string(businessResult)); +} + +std::string UpdateCallRequest::getAccessKeyId() const { + return accessKeyId_; +} + +void UpdateCallRequest::setAccessKeyId(const std::string &accessKeyId) { + accessKeyId_ = accessKeyId; + setParameter(std::string("AccessKeyId"), accessKeyId); +} + +std::string UpdateCallRequest::getCustomCallId() const { + return customCallId_; +} + +void UpdateCallRequest::setCustomCallId(const std::string &customCallId) { + customCallId_ = customCallId; + setParameter(std::string("CustomCallId"), customCallId); +} + diff --git a/smartsales/src/model/UpdateCallResult.cc b/smartsales/src/model/UpdateCallResult.cc new file mode 100644 index 000000000..779cbc4e0 --- /dev/null +++ b/smartsales/src/model/UpdateCallResult.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 +#include + +using namespace AlibabaCloud::SmartSales; +using namespace AlibabaCloud::SmartSales::Model; + +UpdateCallResult::UpdateCallResult() : + ServiceResult() +{} + +UpdateCallResult::UpdateCallResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +UpdateCallResult::~UpdateCallResult() +{} + +void UpdateCallResult::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(); + +} + +std::string UpdateCallResult::getSuccess()const +{ + return success_; +} + diff --git a/smartsales/src/model/UploadVoiceDataRequest.cc b/smartsales/src/model/UploadVoiceDataRequest.cc new file mode 100644 index 000000000..21ed20552 --- /dev/null +++ b/smartsales/src/model/UploadVoiceDataRequest.cc @@ -0,0 +1,71 @@ +/* + * 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::SmartSales::Model::UploadVoiceDataRequest; + +UploadVoiceDataRequest::UploadVoiceDataRequest() + : RpcServiceRequest("smartsales", "2022-08-18", "UploadVoiceData") { + setMethod(HttpRequest::Method::Post); +} + +UploadVoiceDataRequest::~UploadVoiceDataRequest() {} + +std::string UploadVoiceDataRequest::getAgentKey() const { + return agentKey_; +} + +void UploadVoiceDataRequest::setAgentKey(const std::string &agentKey) { + agentKey_ = agentKey; + setParameter(std::string("AgentKey"), agentKey); +} + +std::string UploadVoiceDataRequest::getAccessKeyId() const { + return accessKeyId_; +} + +void UploadVoiceDataRequest::setAccessKeyId(const std::string &accessKeyId) { + accessKeyId_ = accessKeyId; + setParameter(std::string("AccessKeyId"), accessKeyId); +} + +std::vector UploadVoiceDataRequest::getVoiceDataList() const { + return voiceDataList_; +} + +void UploadVoiceDataRequest::setVoiceDataList(const std::vector &voiceDataList) { + voiceDataList_ = voiceDataList; + for(int dep1 = 0; dep1 != voiceDataList.size(); dep1++) { + setParameter(std::string("VoiceDataList") + "." + std::to_string(dep1 + 1) + ".CustomParamJson", voiceDataList[dep1].customParamJson); + setParameter(std::string("VoiceDataList") + "." + std::to_string(dep1 + 1) + ".ClueStatusRemark", voiceDataList[dep1].clueStatusRemark); + setParameter(std::string("VoiceDataList") + "." + std::to_string(dep1 + 1) + ".BeginTime", std::to_string(voiceDataList[dep1].beginTime)); + setParameter(std::string("VoiceDataList") + "." + std::to_string(dep1 + 1) + ".CallChannel", std::to_string(voiceDataList[dep1].callChannel)); + setParameter(std::string("VoiceDataList") + "." + std::to_string(dep1 + 1) + ".BusinessResult", std::to_string(voiceDataList[dep1].businessResult)); + setParameter(std::string("VoiceDataList") + "." + std::to_string(dep1 + 1) + ".CustomCallId", voiceDataList[dep1].customCallId); + setParameter(std::string("VoiceDataList") + "." + std::to_string(dep1 + 1) + ".SalesPersonId", std::to_string(voiceDataList[dep1].salesPersonId)); + setParameter(std::string("VoiceDataList") + "." + std::to_string(dep1 + 1) + ".TeamId", std::to_string(voiceDataList[dep1].teamId)); + setParameter(std::string("VoiceDataList") + "." + std::to_string(dep1 + 1) + ".CustomerId", voiceDataList[dep1].customerId); + setParameter(std::string("VoiceDataList") + "." + std::to_string(dep1 + 1) + ".FileUrl", voiceDataList[dep1].fileUrl); + setParameter(std::string("VoiceDataList") + "." + std::to_string(dep1 + 1) + ".ClientTrackNumber", std::to_string(voiceDataList[dep1].clientTrackNumber)); + setParameter(std::string("VoiceDataList") + "." + std::to_string(dep1 + 1) + ".CustomerName", voiceDataList[dep1].customerName); + setParameter(std::string("VoiceDataList") + "." + std::to_string(dep1 + 1) + ".CallType", std::to_string(voiceDataList[dep1].callType)); + setParameter(std::string("VoiceDataList") + "." + std::to_string(dep1 + 1) + ".CalleeNumber", voiceDataList[dep1].calleeNumber); + setParameter(std::string("VoiceDataList") + "." + std::to_string(dep1 + 1) + ".SalesPersonName", voiceDataList[dep1].salesPersonName); + setParameter(std::string("VoiceDataList") + "." + std::to_string(dep1 + 1) + ".CallerNumber", voiceDataList[dep1].callerNumber); + } +} + diff --git a/smartsales/src/model/UploadVoiceDataResult.cc b/smartsales/src/model/UploadVoiceDataResult.cc new file mode 100644 index 000000000..0e23d61bf --- /dev/null +++ b/smartsales/src/model/UploadVoiceDataResult.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 +#include + +using namespace AlibabaCloud::SmartSales; +using namespace AlibabaCloud::SmartSales::Model; + +UploadVoiceDataResult::UploadVoiceDataResult() : + ServiceResult() +{} + +UploadVoiceDataResult::UploadVoiceDataResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +UploadVoiceDataResult::~UploadVoiceDataResult() +{} + +void UploadVoiceDataResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + if(!value["JobId"].isNull()) + jobId_ = value["JobId"].asString(); + +} + +std::string UploadVoiceDataResult::getJobId()const +{ + return jobId_; +} +