SmartSales-OpenAPI.
This commit is contained in:
90
smartsales/CMakeLists.txt
Normal file
90
smartsales/CMakeLists.txt
Normal file
@@ -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}
|
||||||
|
)
|
||||||
@@ -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 <future>
|
||||||
|
#include <alibabacloud/core/AsyncCallerContext.h>
|
||||||
|
#include <alibabacloud/core/EndpointProvider.h>
|
||||||
|
#include <alibabacloud/core/RpcServiceClient.h>
|
||||||
|
#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<Error, Model::UpdateCallResult> UpdateCallOutcome;
|
||||||
|
typedef std::future<UpdateCallOutcome> UpdateCallOutcomeCallable;
|
||||||
|
typedef std::function<void(const SmartSalesClient*, const Model::UpdateCallRequest&, const UpdateCallOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> UpdateCallAsyncHandler;
|
||||||
|
typedef Outcome<Error, Model::UploadVoiceDataResult> UploadVoiceDataOutcome;
|
||||||
|
typedef std::future<UploadVoiceDataOutcome> UploadVoiceDataOutcomeCallable;
|
||||||
|
typedef std::function<void(const SmartSalesClient*, const Model::UploadVoiceDataRequest&, const UploadVoiceDataOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> UploadVoiceDataAsyncHandler;
|
||||||
|
|
||||||
|
SmartSalesClient(const Credentials &credentials, const ClientConfiguration &configuration);
|
||||||
|
SmartSalesClient(const std::shared_ptr<CredentialsProvider> &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<const AsyncCallerContext>& 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<const AsyncCallerContext>& context = nullptr) const;
|
||||||
|
UploadVoiceDataOutcomeCallable uploadVoiceDataCallable(const Model::UploadVoiceDataRequest& request) const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::shared_ptr<EndpointProvider> endpointProvider_;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // !ALIBABACLOUD_SMARTSALES_SMARTSALESCLIENT_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 <alibabacloud/core/Global.h>
|
||||||
|
|
||||||
|
#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_
|
||||||
@@ -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 <alibabacloud/smartsales/SmartSalesExport.h>
|
||||||
|
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
#include <map>
|
||||||
|
|
||||||
|
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_
|
||||||
@@ -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 <string>
|
||||||
|
#include <vector>
|
||||||
|
#include <utility>
|
||||||
|
#include <alibabacloud/core/ServiceResult.h>
|
||||||
|
#include <alibabacloud/smartsales/SmartSalesExport.h>
|
||||||
|
|
||||||
|
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_
|
||||||
@@ -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 <alibabacloud/smartsales/SmartSalesExport.h>
|
||||||
|
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
#include <map>
|
||||||
|
|
||||||
|
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<VoiceDataList> getVoiceDataList() const;
|
||||||
|
void setVoiceDataList(const std::vector<VoiceDataList> &voiceDataList);
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::string agentKey_;
|
||||||
|
std::string accessKeyId_;
|
||||||
|
std::vector<VoiceDataList> voiceDataList_;
|
||||||
|
};
|
||||||
|
} // namespace Model
|
||||||
|
} // namespace SmartSales
|
||||||
|
} // namespace AlibabaCloud
|
||||||
|
#endif // !ALIBABACLOUD_SMARTSALES_MODEL_UPLOADVOICEDATAREQUEST_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 <string>
|
||||||
|
#include <vector>
|
||||||
|
#include <utility>
|
||||||
|
#include <alibabacloud/core/ServiceResult.h>
|
||||||
|
#include <alibabacloud/smartsales/SmartSalesExport.h>
|
||||||
|
|
||||||
|
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_
|
||||||
125
smartsales/src/SmartSalesClient.cc
Normal file
125
smartsales/src/SmartSalesClient.cc
Normal file
@@ -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 <alibabacloud/smartsales/SmartSalesClient.h>
|
||||||
|
#include <alibabacloud/core/SimpleCredentialsProvider.h>
|
||||||
|
|
||||||
|
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<SimpleCredentialsProvider>(credentials), configuration)
|
||||||
|
{
|
||||||
|
auto locationClient = std::make_shared<LocationClient>(credentials, configuration);
|
||||||
|
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
|
||||||
|
}
|
||||||
|
|
||||||
|
SmartSalesClient::SmartSalesClient(const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) :
|
||||||
|
RpcServiceClient(SERVICE_NAME, credentialsProvider, configuration)
|
||||||
|
{
|
||||||
|
auto locationClient = std::make_shared<LocationClient>(credentialsProvider, configuration);
|
||||||
|
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
|
||||||
|
}
|
||||||
|
|
||||||
|
SmartSalesClient::SmartSalesClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) :
|
||||||
|
RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(accessKeyId, accessKeySecret), configuration)
|
||||||
|
{
|
||||||
|
auto locationClient = std::make_shared<LocationClient>(accessKeyId, accessKeySecret, configuration);
|
||||||
|
endpointProvider_ = std::make_shared<EndpointProvider>(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<const AsyncCallerContext>& 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<std::packaged_task<UpdateCallOutcome()>>(
|
||||||
|
[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<const AsyncCallerContext>& 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<std::packaged_task<UploadVoiceDataOutcome()>>(
|
||||||
|
[this, request]()
|
||||||
|
{
|
||||||
|
return this->uploadVoiceData(request);
|
||||||
|
});
|
||||||
|
|
||||||
|
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||||
|
return task->get_future();
|
||||||
|
}
|
||||||
|
|
||||||
81
smartsales/src/model/UpdateCallRequest.cc
Normal file
81
smartsales/src/model/UpdateCallRequest.cc
Normal file
@@ -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 <alibabacloud/smartsales/model/UpdateCallRequest.h>
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
51
smartsales/src/model/UpdateCallResult.cc
Normal file
51
smartsales/src/model/UpdateCallResult.cc
Normal 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/smartsales/model/UpdateCallResult.h>
|
||||||
|
#include <json/json.h>
|
||||||
|
|
||||||
|
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_;
|
||||||
|
}
|
||||||
|
|
||||||
71
smartsales/src/model/UploadVoiceDataRequest.cc
Normal file
71
smartsales/src/model/UploadVoiceDataRequest.cc
Normal file
@@ -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 <alibabacloud/smartsales/model/UploadVoiceDataRequest.h>
|
||||||
|
|
||||||
|
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::VoiceDataList> UploadVoiceDataRequest::getVoiceDataList() const {
|
||||||
|
return voiceDataList_;
|
||||||
|
}
|
||||||
|
|
||||||
|
void UploadVoiceDataRequest::setVoiceDataList(const std::vector<UploadVoiceDataRequest::VoiceDataList> &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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
51
smartsales/src/model/UploadVoiceDataResult.cc
Normal file
51
smartsales/src/model/UploadVoiceDataResult.cc
Normal 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/smartsales/model/UploadVoiceDataResult.h>
|
||||||
|
#include <json/json.h>
|
||||||
|
|
||||||
|
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_;
|
||||||
|
}
|
||||||
|
|
||||||
Reference in New Issue
Block a user