DYSMSAPI SDK Auto Released By zhangzifa,Version:1.34.62

Signed-off-by: haowei.yao <haowei.yao@alibaba-inc.com>
This commit is contained in:
haowei.yao
2019-03-27 10:37:13 +08:00
parent 5d1aad0c37
commit 25bddc9e7a
19 changed files with 1374 additions and 2 deletions

94
dysmsapi/CMakeLists.txt Normal file
View File

@@ -0,0 +1,94 @@
#
# 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(dysmsapi_public_header
include/alibabacloud/dysmsapi/DysmsapiClient.h
include/alibabacloud/dysmsapi/DysmsapiExport.h )
set(dysmsapi_public_header_model
include/alibabacloud/dysmsapi/model/SendSmsRequest.h
include/alibabacloud/dysmsapi/model/SendSmsResult.h
include/alibabacloud/dysmsapi/model/SendBatchSmsRequest.h
include/alibabacloud/dysmsapi/model/SendBatchSmsResult.h
include/alibabacloud/dysmsapi/model/QuerySendDetailsRequest.h
include/alibabacloud/dysmsapi/model/QuerySendDetailsResult.h )
set(dysmsapi_src
src/DysmsapiClient.cc
src/model/SendSmsRequest.cc
src/model/SendSmsResult.cc
src/model/SendBatchSmsRequest.cc
src/model/SendBatchSmsResult.cc
src/model/QuerySendDetailsRequest.cc
src/model/QuerySendDetailsResult.cc )
add_library(dysmsapi ${LIB_TYPE}
${dysmsapi_public_header}
${dysmsapi_public_header_model}
${dysmsapi_src})
set_target_properties(dysmsapi
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}dysmsapi
)
if(${LIB_TYPE} STREQUAL "SHARED")
set_target_properties(dysmsapi
PROPERTIES
DEFINE_SYMBOL ALIBABACLOUD_DYSMSAPI_LIBRARY)
endif()
target_include_directories(dysmsapi
PRIVATE include
${CMAKE_SOURCE_DIR}/core/include
)
target_link_libraries(dysmsapi
core)
if(CMAKE_HOST_WIN32)
ExternalProject_Get_Property(jsoncpp INSTALL_DIR)
set(jsoncpp_install_dir ${INSTALL_DIR})
add_dependencies(dysmsapi
jsoncpp)
target_include_directories(dysmsapi
PRIVATE ${jsoncpp_install_dir}/include)
target_link_libraries(dysmsapi
${jsoncpp_install_dir}/lib/jsoncpp.lib)
set_target_properties(dysmsapi
PROPERTIES
COMPILE_OPTIONS "/bigobj")
else()
target_include_directories(dysmsapi
PRIVATE /usr/include/jsoncpp)
target_link_libraries(dysmsapi
jsoncpp)
endif()
install(FILES ${dysmsapi_public_header}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/dysmsapi)
install(FILES ${dysmsapi_public_header_model}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/dysmsapi/model)
install(TARGETS dysmsapi
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)

View File

@@ -0,0 +1,70 @@
/*
* 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_DYSMSAPI_DYSMSAPICLIENT_H_
#define ALIBABACLOUD_DYSMSAPI_DYSMSAPICLIENT_H_
#include <future>
#include <alibabacloud/core/AsyncCallerContext.h>
#include <alibabacloud/core/EndpointProvider.h>
#include <alibabacloud/core/RpcServiceClient.h>
#include "DysmsapiExport.h"
#include "model/SendSmsRequest.h"
#include "model/SendSmsResult.h"
#include "model/SendBatchSmsRequest.h"
#include "model/SendBatchSmsResult.h"
#include "model/QuerySendDetailsRequest.h"
#include "model/QuerySendDetailsResult.h"
namespace AlibabaCloud
{
namespace Dysmsapi
{
class ALIBABACLOUD_DYSMSAPI_EXPORT DysmsapiClient : public RpcServiceClient
{
public:
typedef Outcome<Error, Model::SendSmsResult> SendSmsOutcome;
typedef std::future<SendSmsOutcome> SendSmsOutcomeCallable;
typedef std::function<void(const DysmsapiClient*, const Model::SendSmsRequest&, const SendSmsOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> SendSmsAsyncHandler;
typedef Outcome<Error, Model::SendBatchSmsResult> SendBatchSmsOutcome;
typedef std::future<SendBatchSmsOutcome> SendBatchSmsOutcomeCallable;
typedef std::function<void(const DysmsapiClient*, const Model::SendBatchSmsRequest&, const SendBatchSmsOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> SendBatchSmsAsyncHandler;
typedef Outcome<Error, Model::QuerySendDetailsResult> QuerySendDetailsOutcome;
typedef std::future<QuerySendDetailsOutcome> QuerySendDetailsOutcomeCallable;
typedef std::function<void(const DysmsapiClient*, const Model::QuerySendDetailsRequest&, const QuerySendDetailsOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> QuerySendDetailsAsyncHandler;
DysmsapiClient(const Credentials &credentials, const ClientConfiguration &configuration);
DysmsapiClient(const std::shared_ptr<CredentialsProvider> &credentialsProvider, const ClientConfiguration &configuration);
DysmsapiClient(const std::string &accessKeyId, const std::string &accessKeySecret, const ClientConfiguration &configuration);
~DysmsapiClient();
SendSmsOutcome sendSms(const Model::SendSmsRequest &request)const;
void sendSmsAsync(const Model::SendSmsRequest& request, const SendSmsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
SendSmsOutcomeCallable sendSmsCallable(const Model::SendSmsRequest& request) const;
SendBatchSmsOutcome sendBatchSms(const Model::SendBatchSmsRequest &request)const;
void sendBatchSmsAsync(const Model::SendBatchSmsRequest& request, const SendBatchSmsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
SendBatchSmsOutcomeCallable sendBatchSmsCallable(const Model::SendBatchSmsRequest& request) const;
QuerySendDetailsOutcome querySendDetails(const Model::QuerySendDetailsRequest &request)const;
void querySendDetailsAsync(const Model::QuerySendDetailsRequest& request, const QuerySendDetailsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
QuerySendDetailsOutcomeCallable querySendDetailsCallable(const Model::QuerySendDetailsRequest& request) const;
private:
std::shared_ptr<EndpointProvider> endpointProvider_;
};
}
}
#endif // !ALIBABACLOUD_DYSMSAPI_DYSMSAPICLIENT_H_

View File

@@ -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_DYSMSAPI_DYSMSAPIEXPORT_H_
#define ALIBABACLOUD_DYSMSAPI_DYSMSAPIEXPORT_H_
#include <alibabacloud/core/Global.h>
#if defined(ALIBABACLOUD_SHARED)
# if defined(ALIBABACLOUD_DYSMSAPI_LIBRARY)
# define ALIBABACLOUD_DYSMSAPI_EXPORT ALIBABACLOUD_DECL_EXPORT
# else
# define ALIBABACLOUD_DYSMSAPI_EXPORT ALIBABACLOUD_DECL_IMPORT
# endif
#else
# define ALIBABACLOUD_DYSMSAPI_EXPORT
#endif
#endif // !ALIBABACLOUD_DYSMSAPI_DYSMSAPIEXPORT_H_

View File

@@ -0,0 +1,72 @@
/*
* 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_DYSMSAPI_MODEL_QUERYSENDDETAILSREQUEST_H_
#define ALIBABACLOUD_DYSMSAPI_MODEL_QUERYSENDDETAILSREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/dysmsapi/DysmsapiExport.h>
namespace AlibabaCloud
{
namespace Dysmsapi
{
namespace Model
{
class ALIBABACLOUD_DYSMSAPI_EXPORT QuerySendDetailsRequest : public RpcServiceRequest
{
public:
QuerySendDetailsRequest();
~QuerySendDetailsRequest();
long getResourceOwnerId()const;
void setResourceOwnerId(long resourceOwnerId);
std::string getResourceOwnerAccount()const;
void setResourceOwnerAccount(const std::string& resourceOwnerAccount);
std::string getSendDate()const;
void setSendDate(const std::string& sendDate);
std::string getPhoneNumber()const;
void setPhoneNumber(const std::string& phoneNumber);
std::string getBizId()const;
void setBizId(const std::string& bizId);
long getPageSize()const;
void setPageSize(long pageSize);
long getCurrentPage()const;
void setCurrentPage(long currentPage);
long getOwnerId()const;
void setOwnerId(long ownerId);
std::string getAccessKeyId()const;
void setAccessKeyId(const std::string& accessKeyId);
private:
long resourceOwnerId_;
std::string resourceOwnerAccount_;
std::string sendDate_;
std::string phoneNumber_;
std::string bizId_;
long pageSize_;
long currentPage_;
long ownerId_;
std::string accessKeyId_;
};
}
}
}
#endif // !ALIBABACLOUD_DYSMSAPI_MODEL_QUERYSENDDETAILSREQUEST_H_

View File

@@ -0,0 +1,68 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ALIBABACLOUD_DYSMSAPI_MODEL_QUERYSENDDETAILSRESULT_H_
#define ALIBABACLOUD_DYSMSAPI_MODEL_QUERYSENDDETAILSRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/dysmsapi/DysmsapiExport.h>
namespace AlibabaCloud
{
namespace Dysmsapi
{
namespace Model
{
class ALIBABACLOUD_DYSMSAPI_EXPORT QuerySendDetailsResult : public ServiceResult
{
public:
struct SmsSendDetailDTO
{
std::string templateCode;
std::string receiveDate;
std::string phoneNum;
std::string content;
long sendStatus;
std::string outId;
std::string sendDate;
std::string errCode;
};
QuerySendDetailsResult();
explicit QuerySendDetailsResult(const std::string &payload);
~QuerySendDetailsResult();
std::string getTotalCount()const;
std::string getMessage()const;
std::string getCode()const;
std::vector<SmsSendDetailDTO> getSmsSendDetailDTOs()const;
protected:
void parse(const std::string &payload);
private:
std::string totalCount_;
std::string message_;
std::string code_;
std::vector<SmsSendDetailDTO> smsSendDetailDTOs_;
};
}
}
}
#endif // !ALIBABACLOUD_DYSMSAPI_MODEL_QUERYSENDDETAILSRESULT_H_

View File

@@ -0,0 +1,72 @@
/*
* 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_DYSMSAPI_MODEL_SENDBATCHSMSREQUEST_H_
#define ALIBABACLOUD_DYSMSAPI_MODEL_SENDBATCHSMSREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/dysmsapi/DysmsapiExport.h>
namespace AlibabaCloud
{
namespace Dysmsapi
{
namespace Model
{
class ALIBABACLOUD_DYSMSAPI_EXPORT SendBatchSmsRequest : public RpcServiceRequest
{
public:
SendBatchSmsRequest();
~SendBatchSmsRequest();
std::string getTemplateParamJson()const;
void setTemplateParamJson(const std::string& templateParamJson);
long getResourceOwnerId()const;
void setResourceOwnerId(long resourceOwnerId);
std::string getResourceOwnerAccount()const;
void setResourceOwnerAccount(const std::string& resourceOwnerAccount);
std::string getSmsUpExtendCodeJson()const;
void setSmsUpExtendCodeJson(const std::string& smsUpExtendCodeJson);
long getOwnerId()const;
void setOwnerId(long ownerId);
std::string getSignNameJson()const;
void setSignNameJson(const std::string& signNameJson);
std::string getTemplateCode()const;
void setTemplateCode(const std::string& templateCode);
std::string getPhoneNumberJson()const;
void setPhoneNumberJson(const std::string& phoneNumberJson);
std::string getAccessKeyId()const;
void setAccessKeyId(const std::string& accessKeyId);
private:
std::string templateParamJson_;
long resourceOwnerId_;
std::string resourceOwnerAccount_;
std::string smsUpExtendCodeJson_;
long ownerId_;
std::string signNameJson_;
std::string templateCode_;
std::string phoneNumberJson_;
std::string accessKeyId_;
};
}
}
}
#endif // !ALIBABACLOUD_DYSMSAPI_MODEL_SENDBATCHSMSREQUEST_H_

View File

@@ -0,0 +1,55 @@
/*
* 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_DYSMSAPI_MODEL_SENDBATCHSMSRESULT_H_
#define ALIBABACLOUD_DYSMSAPI_MODEL_SENDBATCHSMSRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/dysmsapi/DysmsapiExport.h>
namespace AlibabaCloud
{
namespace Dysmsapi
{
namespace Model
{
class ALIBABACLOUD_DYSMSAPI_EXPORT SendBatchSmsResult : public ServiceResult
{
public:
SendBatchSmsResult();
explicit SendBatchSmsResult(const std::string &payload);
~SendBatchSmsResult();
std::string getMessage()const;
std::string getBizId()const;
std::string getCode()const;
protected:
void parse(const std::string &payload);
private:
std::string message_;
std::string bizId_;
std::string code_;
};
}
}
}
#endif // !ALIBABACLOUD_DYSMSAPI_MODEL_SENDBATCHSMSRESULT_H_

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.
*/
#ifndef ALIBABACLOUD_DYSMSAPI_MODEL_SENDSMSREQUEST_H_
#define ALIBABACLOUD_DYSMSAPI_MODEL_SENDSMSREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/dysmsapi/DysmsapiExport.h>
namespace AlibabaCloud
{
namespace Dysmsapi
{
namespace Model
{
class ALIBABACLOUD_DYSMSAPI_EXPORT SendSmsRequest : public RpcServiceRequest
{
public:
SendSmsRequest();
~SendSmsRequest();
std::string getSmsUpExtendCode()const;
void setSmsUpExtendCode(const std::string& smsUpExtendCode);
long getResourceOwnerId()const;
void setResourceOwnerId(long resourceOwnerId);
std::string getSignName()const;
void setSignName(const std::string& signName);
std::string getResourceOwnerAccount()const;
void setResourceOwnerAccount(const std::string& resourceOwnerAccount);
std::string getPhoneNumbers()const;
void setPhoneNumbers(const std::string& phoneNumbers);
std::string getOutId()const;
void setOutId(const std::string& outId);
long getOwnerId()const;
void setOwnerId(long ownerId);
std::string getTemplateCode()const;
void setTemplateCode(const std::string& templateCode);
std::string getAccessKeyId()const;
void setAccessKeyId(const std::string& accessKeyId);
std::string getTemplateParam()const;
void setTemplateParam(const std::string& templateParam);
private:
std::string smsUpExtendCode_;
long resourceOwnerId_;
std::string signName_;
std::string resourceOwnerAccount_;
std::string phoneNumbers_;
std::string outId_;
long ownerId_;
std::string templateCode_;
std::string accessKeyId_;
std::string templateParam_;
};
}
}
}
#endif // !ALIBABACLOUD_DYSMSAPI_MODEL_SENDSMSREQUEST_H_

View File

@@ -0,0 +1,55 @@
/*
* 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_DYSMSAPI_MODEL_SENDSMSRESULT_H_
#define ALIBABACLOUD_DYSMSAPI_MODEL_SENDSMSRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/dysmsapi/DysmsapiExport.h>
namespace AlibabaCloud
{
namespace Dysmsapi
{
namespace Model
{
class ALIBABACLOUD_DYSMSAPI_EXPORT SendSmsResult : public ServiceResult
{
public:
SendSmsResult();
explicit SendSmsResult(const std::string &payload);
~SendSmsResult();
std::string getMessage()const;
std::string getBizId()const;
std::string getCode()const;
protected:
void parse(const std::string &payload);
private:
std::string message_;
std::string bizId_;
std::string code_;
};
}
}
}
#endif // !ALIBABACLOUD_DYSMSAPI_MODEL_SENDSMSRESULT_H_

View File

@@ -0,0 +1,161 @@
/*
* 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/dysmsapi/DysmsapiClient.h>
#include <alibabacloud/core/SimpleCredentialsProvider.h>
using namespace AlibabaCloud;
using namespace AlibabaCloud::Location;
using namespace AlibabaCloud::Dysmsapi;
using namespace AlibabaCloud::Dysmsapi::Model;
namespace
{
const std::string SERVICE_NAME = "Dysmsapi";
}
DysmsapiClient::DysmsapiClient(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, "dysmsapi");
}
DysmsapiClient::DysmsapiClient(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, "dysmsapi");
}
DysmsapiClient::DysmsapiClient(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, "dysmsapi");
}
DysmsapiClient::~DysmsapiClient()
{}
DysmsapiClient::SendSmsOutcome DysmsapiClient::sendSms(const SendSmsRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return SendSmsOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return SendSmsOutcome(SendSmsResult(outcome.result()));
else
return SendSmsOutcome(outcome.error());
}
void DysmsapiClient::sendSmsAsync(const SendSmsRequest& request, const SendSmsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, sendSms(request), context);
};
asyncExecute(new Runnable(fn));
}
DysmsapiClient::SendSmsOutcomeCallable DysmsapiClient::sendSmsCallable(const SendSmsRequest &request) const
{
auto task = std::make_shared<std::packaged_task<SendSmsOutcome()>>(
[this, request]()
{
return this->sendSms(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
DysmsapiClient::SendBatchSmsOutcome DysmsapiClient::sendBatchSms(const SendBatchSmsRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return SendBatchSmsOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return SendBatchSmsOutcome(SendBatchSmsResult(outcome.result()));
else
return SendBatchSmsOutcome(outcome.error());
}
void DysmsapiClient::sendBatchSmsAsync(const SendBatchSmsRequest& request, const SendBatchSmsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, sendBatchSms(request), context);
};
asyncExecute(new Runnable(fn));
}
DysmsapiClient::SendBatchSmsOutcomeCallable DysmsapiClient::sendBatchSmsCallable(const SendBatchSmsRequest &request) const
{
auto task = std::make_shared<std::packaged_task<SendBatchSmsOutcome()>>(
[this, request]()
{
return this->sendBatchSms(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
DysmsapiClient::QuerySendDetailsOutcome DysmsapiClient::querySendDetails(const QuerySendDetailsRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return QuerySendDetailsOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return QuerySendDetailsOutcome(QuerySendDetailsResult(outcome.result()));
else
return QuerySendDetailsOutcome(outcome.error());
}
void DysmsapiClient::querySendDetailsAsync(const QuerySendDetailsRequest& request, const QuerySendDetailsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, querySendDetails(request), context);
};
asyncExecute(new Runnable(fn));
}
DysmsapiClient::QuerySendDetailsOutcomeCallable DysmsapiClient::querySendDetailsCallable(const QuerySendDetailsRequest &request) const
{
auto task = std::make_shared<std::packaged_task<QuerySendDetailsOutcome()>>(
[this, request]()
{
return this->querySendDetails(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}

View File

@@ -0,0 +1,126 @@
/*
* 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/dysmsapi/model/QuerySendDetailsRequest.h>
using AlibabaCloud::Dysmsapi::Model::QuerySendDetailsRequest;
QuerySendDetailsRequest::QuerySendDetailsRequest() :
RpcServiceRequest("dysmsapi", "2017-05-25", "QuerySendDetails")
{}
QuerySendDetailsRequest::~QuerySendDetailsRequest()
{}
long QuerySendDetailsRequest::getResourceOwnerId()const
{
return resourceOwnerId_;
}
void QuerySendDetailsRequest::setResourceOwnerId(long resourceOwnerId)
{
resourceOwnerId_ = resourceOwnerId;
setParameter("ResourceOwnerId", std::to_string(resourceOwnerId));
}
std::string QuerySendDetailsRequest::getResourceOwnerAccount()const
{
return resourceOwnerAccount_;
}
void QuerySendDetailsRequest::setResourceOwnerAccount(const std::string& resourceOwnerAccount)
{
resourceOwnerAccount_ = resourceOwnerAccount;
setParameter("ResourceOwnerAccount", resourceOwnerAccount);
}
std::string QuerySendDetailsRequest::getSendDate()const
{
return sendDate_;
}
void QuerySendDetailsRequest::setSendDate(const std::string& sendDate)
{
sendDate_ = sendDate;
setParameter("SendDate", sendDate);
}
std::string QuerySendDetailsRequest::getPhoneNumber()const
{
return phoneNumber_;
}
void QuerySendDetailsRequest::setPhoneNumber(const std::string& phoneNumber)
{
phoneNumber_ = phoneNumber;
setParameter("PhoneNumber", phoneNumber);
}
std::string QuerySendDetailsRequest::getBizId()const
{
return bizId_;
}
void QuerySendDetailsRequest::setBizId(const std::string& bizId)
{
bizId_ = bizId;
setParameter("BizId", bizId);
}
long QuerySendDetailsRequest::getPageSize()const
{
return pageSize_;
}
void QuerySendDetailsRequest::setPageSize(long pageSize)
{
pageSize_ = pageSize;
setParameter("PageSize", std::to_string(pageSize));
}
long QuerySendDetailsRequest::getCurrentPage()const
{
return currentPage_;
}
void QuerySendDetailsRequest::setCurrentPage(long currentPage)
{
currentPage_ = currentPage;
setParameter("CurrentPage", std::to_string(currentPage));
}
long QuerySendDetailsRequest::getOwnerId()const
{
return ownerId_;
}
void QuerySendDetailsRequest::setOwnerId(long ownerId)
{
ownerId_ = ownerId;
setParameter("OwnerId", std::to_string(ownerId));
}
std::string QuerySendDetailsRequest::getAccessKeyId()const
{
return accessKeyId_;
}
void QuerySendDetailsRequest::setAccessKeyId(const std::string& accessKeyId)
{
accessKeyId_ = accessKeyId;
setParameter("AccessKeyId", accessKeyId);
}

View File

@@ -0,0 +1,93 @@
/*
* 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/dysmsapi/model/QuerySendDetailsResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Dysmsapi;
using namespace AlibabaCloud::Dysmsapi::Model;
QuerySendDetailsResult::QuerySendDetailsResult() :
ServiceResult()
{}
QuerySendDetailsResult::QuerySendDetailsResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
QuerySendDetailsResult::~QuerySendDetailsResult()
{}
void QuerySendDetailsResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto allSmsSendDetailDTOs = value["SmsSendDetailDTOs"]["SmsSendDetailDTO"];
for (auto value : allSmsSendDetailDTOs)
{
SmsSendDetailDTO smsSendDetailDTOsObject;
if(!value["PhoneNum"].isNull())
smsSendDetailDTOsObject.phoneNum = value["PhoneNum"].asString();
if(!value["SendStatus"].isNull())
smsSendDetailDTOsObject.sendStatus = std::stol(value["SendStatus"].asString());
if(!value["ErrCode"].isNull())
smsSendDetailDTOsObject.errCode = value["ErrCode"].asString();
if(!value["TemplateCode"].isNull())
smsSendDetailDTOsObject.templateCode = value["TemplateCode"].asString();
if(!value["Content"].isNull())
smsSendDetailDTOsObject.content = value["Content"].asString();
if(!value["SendDate"].isNull())
smsSendDetailDTOsObject.sendDate = value["SendDate"].asString();
if(!value["ReceiveDate"].isNull())
smsSendDetailDTOsObject.receiveDate = value["ReceiveDate"].asString();
if(!value["OutId"].isNull())
smsSendDetailDTOsObject.outId = value["OutId"].asString();
smsSendDetailDTOs_.push_back(smsSendDetailDTOsObject);
}
if(!value["Code"].isNull())
code_ = value["Code"].asString();
if(!value["Message"].isNull())
message_ = value["Message"].asString();
if(!value["TotalCount"].isNull())
totalCount_ = value["TotalCount"].asString();
}
std::string QuerySendDetailsResult::getTotalCount()const
{
return totalCount_;
}
std::string QuerySendDetailsResult::getMessage()const
{
return message_;
}
std::string QuerySendDetailsResult::getCode()const
{
return code_;
}
std::vector<QuerySendDetailsResult::SmsSendDetailDTO> QuerySendDetailsResult::getSmsSendDetailDTOs()const
{
return smsSendDetailDTOs_;
}

View File

@@ -0,0 +1,126 @@
/*
* 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/dysmsapi/model/SendBatchSmsRequest.h>
using AlibabaCloud::Dysmsapi::Model::SendBatchSmsRequest;
SendBatchSmsRequest::SendBatchSmsRequest() :
RpcServiceRequest("dysmsapi", "2017-05-25", "SendBatchSms")
{}
SendBatchSmsRequest::~SendBatchSmsRequest()
{}
std::string SendBatchSmsRequest::getTemplateParamJson()const
{
return templateParamJson_;
}
void SendBatchSmsRequest::setTemplateParamJson(const std::string& templateParamJson)
{
templateParamJson_ = templateParamJson;
setParameter("TemplateParamJson", templateParamJson);
}
long SendBatchSmsRequest::getResourceOwnerId()const
{
return resourceOwnerId_;
}
void SendBatchSmsRequest::setResourceOwnerId(long resourceOwnerId)
{
resourceOwnerId_ = resourceOwnerId;
setParameter("ResourceOwnerId", std::to_string(resourceOwnerId));
}
std::string SendBatchSmsRequest::getResourceOwnerAccount()const
{
return resourceOwnerAccount_;
}
void SendBatchSmsRequest::setResourceOwnerAccount(const std::string& resourceOwnerAccount)
{
resourceOwnerAccount_ = resourceOwnerAccount;
setParameter("ResourceOwnerAccount", resourceOwnerAccount);
}
std::string SendBatchSmsRequest::getSmsUpExtendCodeJson()const
{
return smsUpExtendCodeJson_;
}
void SendBatchSmsRequest::setSmsUpExtendCodeJson(const std::string& smsUpExtendCodeJson)
{
smsUpExtendCodeJson_ = smsUpExtendCodeJson;
setParameter("SmsUpExtendCodeJson", smsUpExtendCodeJson);
}
long SendBatchSmsRequest::getOwnerId()const
{
return ownerId_;
}
void SendBatchSmsRequest::setOwnerId(long ownerId)
{
ownerId_ = ownerId;
setParameter("OwnerId", std::to_string(ownerId));
}
std::string SendBatchSmsRequest::getSignNameJson()const
{
return signNameJson_;
}
void SendBatchSmsRequest::setSignNameJson(const std::string& signNameJson)
{
signNameJson_ = signNameJson;
setParameter("SignNameJson", signNameJson);
}
std::string SendBatchSmsRequest::getTemplateCode()const
{
return templateCode_;
}
void SendBatchSmsRequest::setTemplateCode(const std::string& templateCode)
{
templateCode_ = templateCode;
setParameter("TemplateCode", templateCode);
}
std::string SendBatchSmsRequest::getPhoneNumberJson()const
{
return phoneNumberJson_;
}
void SendBatchSmsRequest::setPhoneNumberJson(const std::string& phoneNumberJson)
{
phoneNumberJson_ = phoneNumberJson;
setParameter("PhoneNumberJson", phoneNumberJson);
}
std::string SendBatchSmsRequest::getAccessKeyId()const
{
return accessKeyId_;
}
void SendBatchSmsRequest::setAccessKeyId(const std::string& accessKeyId)
{
accessKeyId_ = accessKeyId;
setParameter("AccessKeyId", accessKeyId);
}

View File

@@ -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.
*/
#include <alibabacloud/dysmsapi/model/SendBatchSmsResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Dysmsapi;
using namespace AlibabaCloud::Dysmsapi::Model;
SendBatchSmsResult::SendBatchSmsResult() :
ServiceResult()
{}
SendBatchSmsResult::SendBatchSmsResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
SendBatchSmsResult::~SendBatchSmsResult()
{}
void SendBatchSmsResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
if(!value["BizId"].isNull())
bizId_ = value["BizId"].asString();
if(!value["Code"].isNull())
code_ = value["Code"].asString();
if(!value["Message"].isNull())
message_ = value["Message"].asString();
}
std::string SendBatchSmsResult::getMessage()const
{
return message_;
}
std::string SendBatchSmsResult::getBizId()const
{
return bizId_;
}
std::string SendBatchSmsResult::getCode()const
{
return code_;
}

View File

@@ -0,0 +1,137 @@
/*
* 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/dysmsapi/model/SendSmsRequest.h>
using AlibabaCloud::Dysmsapi::Model::SendSmsRequest;
SendSmsRequest::SendSmsRequest() :
RpcServiceRequest("dysmsapi", "2017-05-25", "SendSms")
{}
SendSmsRequest::~SendSmsRequest()
{}
std::string SendSmsRequest::getSmsUpExtendCode()const
{
return smsUpExtendCode_;
}
void SendSmsRequest::setSmsUpExtendCode(const std::string& smsUpExtendCode)
{
smsUpExtendCode_ = smsUpExtendCode;
setParameter("SmsUpExtendCode", smsUpExtendCode);
}
long SendSmsRequest::getResourceOwnerId()const
{
return resourceOwnerId_;
}
void SendSmsRequest::setResourceOwnerId(long resourceOwnerId)
{
resourceOwnerId_ = resourceOwnerId;
setParameter("ResourceOwnerId", std::to_string(resourceOwnerId));
}
std::string SendSmsRequest::getSignName()const
{
return signName_;
}
void SendSmsRequest::setSignName(const std::string& signName)
{
signName_ = signName;
setParameter("SignName", signName);
}
std::string SendSmsRequest::getResourceOwnerAccount()const
{
return resourceOwnerAccount_;
}
void SendSmsRequest::setResourceOwnerAccount(const std::string& resourceOwnerAccount)
{
resourceOwnerAccount_ = resourceOwnerAccount;
setParameter("ResourceOwnerAccount", resourceOwnerAccount);
}
std::string SendSmsRequest::getPhoneNumbers()const
{
return phoneNumbers_;
}
void SendSmsRequest::setPhoneNumbers(const std::string& phoneNumbers)
{
phoneNumbers_ = phoneNumbers;
setParameter("PhoneNumbers", phoneNumbers);
}
std::string SendSmsRequest::getOutId()const
{
return outId_;
}
void SendSmsRequest::setOutId(const std::string& outId)
{
outId_ = outId;
setParameter("OutId", outId);
}
long SendSmsRequest::getOwnerId()const
{
return ownerId_;
}
void SendSmsRequest::setOwnerId(long ownerId)
{
ownerId_ = ownerId;
setParameter("OwnerId", std::to_string(ownerId));
}
std::string SendSmsRequest::getTemplateCode()const
{
return templateCode_;
}
void SendSmsRequest::setTemplateCode(const std::string& templateCode)
{
templateCode_ = templateCode;
setParameter("TemplateCode", templateCode);
}
std::string SendSmsRequest::getAccessKeyId()const
{
return accessKeyId_;
}
void SendSmsRequest::setAccessKeyId(const std::string& accessKeyId)
{
accessKeyId_ = accessKeyId;
setParameter("AccessKeyId", accessKeyId);
}
std::string SendSmsRequest::getTemplateParam()const
{
return templateParam_;
}
void SendSmsRequest::setTemplateParam(const std::string& templateParam)
{
templateParam_ = templateParam;
setParameter("TemplateParam", templateParam);
}

View File

@@ -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.
*/
#include <alibabacloud/dysmsapi/model/SendSmsResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Dysmsapi;
using namespace AlibabaCloud::Dysmsapi::Model;
SendSmsResult::SendSmsResult() :
ServiceResult()
{}
SendSmsResult::SendSmsResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
SendSmsResult::~SendSmsResult()
{}
void SendSmsResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
if(!value["BizId"].isNull())
bizId_ = value["BizId"].asString();
if(!value["Code"].isNull())
code_ = value["Code"].asString();
if(!value["Message"].isNull())
message_ = value["Message"].asString();
}
std::string SendSmsResult::getMessage()const
{
return message_;
}
std::string SendSmsResult::getBizId()const
{
return bizId_;
}
std::string SendSmsResult::getCode()const
{
return code_;
}