From 8c9353a007f6a3615079e416e1678bacf2bd67ed Mon Sep 17 00:00:00 2001 From: "haowei.yao" Date: Fri, 15 Mar 2019 16:33:42 +0800 Subject: [PATCH] =?UTF-8?q?UBSMS=20SDK=20Auto=20Released=20By=20shenshi,Ve?= =?UTF-8?q?rsion=EF=BC=9A1.34.34?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: haowei.yao --- CHANGELOG | 3 + CMakeLists.txt | 3 +- VERSION | 2 +- ubsms/CMakeLists.txt | 94 ++++++++++ .../include/alibabacloud/ubsms/UbsmsClient.h | 70 ++++++++ .../include/alibabacloud/ubsms/UbsmsExport.h | 32 ++++ .../model/DescribeBusinessStatusRequest.h | 51 ++++++ .../model/DescribeBusinessStatusResult.h | 64 +++++++ .../model/NotifyUserBusinessCommandRequest.h | 66 +++++++ .../model/NotifyUserBusinessCommandResult.h | 51 ++++++ .../model/SetUserBusinessStatusRequest.h | 57 +++++++ .../ubsms/model/SetUserBusinessStatusResult.h | 51 ++++++ ubsms/src/UbsmsClient.cc | 161 ++++++++++++++++++ .../model/DescribeBusinessStatusRequest.cc | 49 ++++++ .../src/model/DescribeBusinessStatusResult.cc | 77 +++++++++ .../model/NotifyUserBusinessCommandRequest.cc | 104 +++++++++++ .../model/NotifyUserBusinessCommandResult.cc | 52 ++++++ .../src/model/SetUserBusinessStatusRequest.cc | 71 ++++++++ .../src/model/SetUserBusinessStatusResult.cc | 52 ++++++ 19 files changed, 1108 insertions(+), 2 deletions(-) create mode 100644 ubsms/CMakeLists.txt create mode 100644 ubsms/include/alibabacloud/ubsms/UbsmsClient.h create mode 100644 ubsms/include/alibabacloud/ubsms/UbsmsExport.h create mode 100644 ubsms/include/alibabacloud/ubsms/model/DescribeBusinessStatusRequest.h create mode 100644 ubsms/include/alibabacloud/ubsms/model/DescribeBusinessStatusResult.h create mode 100644 ubsms/include/alibabacloud/ubsms/model/NotifyUserBusinessCommandRequest.h create mode 100644 ubsms/include/alibabacloud/ubsms/model/NotifyUserBusinessCommandResult.h create mode 100644 ubsms/include/alibabacloud/ubsms/model/SetUserBusinessStatusRequest.h create mode 100644 ubsms/include/alibabacloud/ubsms/model/SetUserBusinessStatusResult.h create mode 100644 ubsms/src/UbsmsClient.cc create mode 100644 ubsms/src/model/DescribeBusinessStatusRequest.cc create mode 100644 ubsms/src/model/DescribeBusinessStatusResult.cc create mode 100644 ubsms/src/model/NotifyUserBusinessCommandRequest.cc create mode 100644 ubsms/src/model/NotifyUserBusinessCommandResult.cc create mode 100644 ubsms/src/model/SetUserBusinessStatusRequest.cc create mode 100644 ubsms/src/model/SetUserBusinessStatusResult.cc diff --git a/CHANGELOG b/CHANGELOG index a7c016335..d643f7d8a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2019-03-15 Version: 1.34.34 +1, Update Dependency + 2019-03-15 Version: 1.34.33 1, Update Dependency diff --git a/CMakeLists.txt b/CMakeLists.txt index 91896d110..8f6892507 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -102,4 +102,5 @@ add_subdirectory(sas-api) add_subdirectory(cr) add_subdirectory(finmall) add_subdirectory(openanalytics) -add_subdirectory(snsuapi) \ No newline at end of file +add_subdirectory(snsuapi) +add_subdirectory(ubsms) \ No newline at end of file diff --git a/VERSION b/VERSION index a1adcb58b..581fc596a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.34.33 \ No newline at end of file +1.34.34 \ No newline at end of file diff --git a/ubsms/CMakeLists.txt b/ubsms/CMakeLists.txt new file mode 100644 index 000000000..ef11ce71b --- /dev/null +++ b/ubsms/CMakeLists.txt @@ -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(ubsms_public_header + include/alibabacloud/ubsms/UbsmsClient.h + include/alibabacloud/ubsms/UbsmsExport.h ) + +set(ubsms_public_header_model + include/alibabacloud/ubsms/model/NotifyUserBusinessCommandRequest.h + include/alibabacloud/ubsms/model/NotifyUserBusinessCommandResult.h + include/alibabacloud/ubsms/model/DescribeBusinessStatusRequest.h + include/alibabacloud/ubsms/model/DescribeBusinessStatusResult.h + include/alibabacloud/ubsms/model/SetUserBusinessStatusRequest.h + include/alibabacloud/ubsms/model/SetUserBusinessStatusResult.h ) + +set(ubsms_src + src/UbsmsClient.cc + src/model/NotifyUserBusinessCommandRequest.cc + src/model/NotifyUserBusinessCommandResult.cc + src/model/DescribeBusinessStatusRequest.cc + src/model/DescribeBusinessStatusResult.cc + src/model/SetUserBusinessStatusRequest.cc + src/model/SetUserBusinessStatusResult.cc ) + +add_library(ubsms ${LIB_TYPE} + ${ubsms_public_header} + ${ubsms_public_header_model} + ${ubsms_src}) + +set_target_properties(ubsms + 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}ubsms + ) + +if(${LIB_TYPE} STREQUAL "SHARED") + set_target_properties(ubsms + PROPERTIES + DEFINE_SYMBOL ALIBABACLOUD_UBSMS_LIBRARY) +endif() + +target_include_directories(ubsms + PRIVATE include + ${CMAKE_SOURCE_DIR}/core/include + ) +target_link_libraries(ubsms + core) + +if(CMAKE_HOST_WIN32) + ExternalProject_Get_Property(jsoncpp INSTALL_DIR) + set(jsoncpp_install_dir ${INSTALL_DIR}) + add_dependencies(ubsms + jsoncpp) + target_include_directories(ubsms + PRIVATE ${jsoncpp_install_dir}/include) + target_link_libraries(ubsms + ${jsoncpp_install_dir}/lib/jsoncpp.lib) + set_target_properties(ubsms + PROPERTIES + COMPILE_OPTIONS "/bigobj") +else() + target_include_directories(ubsms + PRIVATE /usr/include/jsoncpp) + target_link_libraries(ubsms + jsoncpp) +endif() + +install(FILES ${ubsms_public_header} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/ubsms) +install(FILES ${ubsms_public_header_model} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/ubsms/model) +install(TARGETS ubsms + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ) \ No newline at end of file diff --git a/ubsms/include/alibabacloud/ubsms/UbsmsClient.h b/ubsms/include/alibabacloud/ubsms/UbsmsClient.h new file mode 100644 index 000000000..f7f3cb3bd --- /dev/null +++ b/ubsms/include/alibabacloud/ubsms/UbsmsClient.h @@ -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_UBSMS_UBSMSCLIENT_H_ +#define ALIBABACLOUD_UBSMS_UBSMSCLIENT_H_ + +#include +#include +#include +#include +#include "UbsmsExport.h" +#include "model/NotifyUserBusinessCommandRequest.h" +#include "model/NotifyUserBusinessCommandResult.h" +#include "model/DescribeBusinessStatusRequest.h" +#include "model/DescribeBusinessStatusResult.h" +#include "model/SetUserBusinessStatusRequest.h" +#include "model/SetUserBusinessStatusResult.h" + + +namespace AlibabaCloud +{ + namespace Ubsms + { + class ALIBABACLOUD_UBSMS_EXPORT UbsmsClient : public RpcServiceClient + { + public: + typedef Outcome NotifyUserBusinessCommandOutcome; + typedef std::future NotifyUserBusinessCommandOutcomeCallable; + typedef std::function&)> NotifyUserBusinessCommandAsyncHandler; + typedef Outcome DescribeBusinessStatusOutcome; + typedef std::future DescribeBusinessStatusOutcomeCallable; + typedef std::function&)> DescribeBusinessStatusAsyncHandler; + typedef Outcome SetUserBusinessStatusOutcome; + typedef std::future SetUserBusinessStatusOutcomeCallable; + typedef std::function&)> SetUserBusinessStatusAsyncHandler; + + UbsmsClient(const Credentials &credentials, const ClientConfiguration &configuration); + UbsmsClient(const std::shared_ptr &credentialsProvider, const ClientConfiguration &configuration); + UbsmsClient(const std::string &accessKeyId, const std::string &accessKeySecret, const ClientConfiguration &configuration); + ~UbsmsClient(); + NotifyUserBusinessCommandOutcome notifyUserBusinessCommand(const Model::NotifyUserBusinessCommandRequest &request)const; + void notifyUserBusinessCommandAsync(const Model::NotifyUserBusinessCommandRequest& request, const NotifyUserBusinessCommandAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + NotifyUserBusinessCommandOutcomeCallable notifyUserBusinessCommandCallable(const Model::NotifyUserBusinessCommandRequest& request) const; + DescribeBusinessStatusOutcome describeBusinessStatus(const Model::DescribeBusinessStatusRequest &request)const; + void describeBusinessStatusAsync(const Model::DescribeBusinessStatusRequest& request, const DescribeBusinessStatusAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + DescribeBusinessStatusOutcomeCallable describeBusinessStatusCallable(const Model::DescribeBusinessStatusRequest& request) const; + SetUserBusinessStatusOutcome setUserBusinessStatus(const Model::SetUserBusinessStatusRequest &request)const; + void setUserBusinessStatusAsync(const Model::SetUserBusinessStatusRequest& request, const SetUserBusinessStatusAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + SetUserBusinessStatusOutcomeCallable setUserBusinessStatusCallable(const Model::SetUserBusinessStatusRequest& request) const; + + private: + std::shared_ptr endpointProvider_; + }; + } +} + +#endif // !ALIBABACLOUD_UBSMS_UBSMSCLIENT_H_ diff --git a/ubsms/include/alibabacloud/ubsms/UbsmsExport.h b/ubsms/include/alibabacloud/ubsms/UbsmsExport.h new file mode 100644 index 000000000..7cbad0eb7 --- /dev/null +++ b/ubsms/include/alibabacloud/ubsms/UbsmsExport.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_UBSMS_UBSMSEXPORT_H_ +#define ALIBABACLOUD_UBSMS_UBSMSEXPORT_H_ + +#include + +#if defined(ALIBABACLOUD_SHARED) +# if defined(ALIBABACLOUD_UBSMS_LIBRARY) +# define ALIBABACLOUD_UBSMS_EXPORT ALIBABACLOUD_DECL_EXPORT +# else +# define ALIBABACLOUD_UBSMS_EXPORT ALIBABACLOUD_DECL_IMPORT +# endif +#else +# define ALIBABACLOUD_UBSMS_EXPORT +#endif + +#endif // !ALIBABACLOUD_UBSMS_UBSMSEXPORT_H_ \ No newline at end of file diff --git a/ubsms/include/alibabacloud/ubsms/model/DescribeBusinessStatusRequest.h b/ubsms/include/alibabacloud/ubsms/model/DescribeBusinessStatusRequest.h new file mode 100644 index 000000000..67df8804a --- /dev/null +++ b/ubsms/include/alibabacloud/ubsms/model/DescribeBusinessStatusRequest.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_UBSMS_MODEL_DESCRIBEBUSINESSSTATUSREQUEST_H_ +#define ALIBABACLOUD_UBSMS_MODEL_DESCRIBEBUSINESSSTATUSREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Ubsms + { + namespace Model + { + class ALIBABACLOUD_UBSMS_EXPORT DescribeBusinessStatusRequest : public RpcServiceRequest + { + + public: + DescribeBusinessStatusRequest(); + ~DescribeBusinessStatusRequest(); + + std::string getPassword()const; + void setPassword(const std::string& password); + std::string getCallerBid()const; + void setCallerBid(const std::string& callerBid); + + private: + std::string password_; + std::string callerBid_; + + }; + } + } +} +#endif // !ALIBABACLOUD_UBSMS_MODEL_DESCRIBEBUSINESSSTATUSREQUEST_H_ \ No newline at end of file diff --git a/ubsms/include/alibabacloud/ubsms/model/DescribeBusinessStatusResult.h b/ubsms/include/alibabacloud/ubsms/model/DescribeBusinessStatusResult.h new file mode 100644 index 000000000..6c34986a9 --- /dev/null +++ b/ubsms/include/alibabacloud/ubsms/model/DescribeBusinessStatusResult.h @@ -0,0 +1,64 @@ +/* + * 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_UBSMS_MODEL_DESCRIBEBUSINESSSTATUSRESULT_H_ +#define ALIBABACLOUD_UBSMS_MODEL_DESCRIBEBUSINESSSTATUSRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Ubsms + { + namespace Model + { + class ALIBABACLOUD_UBSMS_EXPORT DescribeBusinessStatusResult : public ServiceResult + { + public: + struct UserBusinessStatus + { + struct Status + { + std::string statusKey; + std::string statusValue; + }; + std::string uid; + std::string serviceCode; + std::vector statuses; + }; + + + DescribeBusinessStatusResult(); + explicit DescribeBusinessStatusResult(const std::string &payload); + ~DescribeBusinessStatusResult(); + std::vector getUserBusinessStatusList()const; + bool getSuccess()const; + + protected: + void parse(const std::string &payload); + private: + std::vector userBusinessStatusList_; + bool success_; + + }; + } + } +} +#endif // !ALIBABACLOUD_UBSMS_MODEL_DESCRIBEBUSINESSSTATUSRESULT_H_ \ No newline at end of file diff --git a/ubsms/include/alibabacloud/ubsms/model/NotifyUserBusinessCommandRequest.h b/ubsms/include/alibabacloud/ubsms/model/NotifyUserBusinessCommandRequest.h new file mode 100644 index 000000000..ed0fe9d85 --- /dev/null +++ b/ubsms/include/alibabacloud/ubsms/model/NotifyUserBusinessCommandRequest.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_UBSMS_MODEL_NOTIFYUSERBUSINESSCOMMANDREQUEST_H_ +#define ALIBABACLOUD_UBSMS_MODEL_NOTIFYUSERBUSINESSCOMMANDREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Ubsms + { + namespace Model + { + class ALIBABACLOUD_UBSMS_EXPORT NotifyUserBusinessCommandRequest : public RpcServiceRequest + { + + public: + NotifyUserBusinessCommandRequest(); + ~NotifyUserBusinessCommandRequest(); + + std::string getUid()const; + void setUid(const std::string& uid); + std::string getPassword()const; + void setPassword(const std::string& password); + std::string getInstanceId()const; + void setInstanceId(const std::string& instanceId); + std::string getServiceCode()const; + void setServiceCode(const std::string& serviceCode); + std::string getClientToken()const; + void setClientToken(const std::string& clientToken); + std::string getCmd()const; + void setCmd(const std::string& cmd); + std::string getRegion()const; + void setRegion(const std::string& region); + + private: + std::string uid_; + std::string password_; + std::string instanceId_; + std::string serviceCode_; + std::string clientToken_; + std::string cmd_; + std::string region_; + + }; + } + } +} +#endif // !ALIBABACLOUD_UBSMS_MODEL_NOTIFYUSERBUSINESSCOMMANDREQUEST_H_ \ No newline at end of file diff --git a/ubsms/include/alibabacloud/ubsms/model/NotifyUserBusinessCommandResult.h b/ubsms/include/alibabacloud/ubsms/model/NotifyUserBusinessCommandResult.h new file mode 100644 index 000000000..bd0e5deeb --- /dev/null +++ b/ubsms/include/alibabacloud/ubsms/model/NotifyUserBusinessCommandResult.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_UBSMS_MODEL_NOTIFYUSERBUSINESSCOMMANDRESULT_H_ +#define ALIBABACLOUD_UBSMS_MODEL_NOTIFYUSERBUSINESSCOMMANDRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Ubsms + { + namespace Model + { + class ALIBABACLOUD_UBSMS_EXPORT NotifyUserBusinessCommandResult : public ServiceResult + { + public: + + + NotifyUserBusinessCommandResult(); + explicit NotifyUserBusinessCommandResult(const std::string &payload); + ~NotifyUserBusinessCommandResult(); + bool getSuccess()const; + + protected: + void parse(const std::string &payload); + private: + bool success_; + + }; + } + } +} +#endif // !ALIBABACLOUD_UBSMS_MODEL_NOTIFYUSERBUSINESSCOMMANDRESULT_H_ \ No newline at end of file diff --git a/ubsms/include/alibabacloud/ubsms/model/SetUserBusinessStatusRequest.h b/ubsms/include/alibabacloud/ubsms/model/SetUserBusinessStatusRequest.h new file mode 100644 index 000000000..3f784078f --- /dev/null +++ b/ubsms/include/alibabacloud/ubsms/model/SetUserBusinessStatusRequest.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_UBSMS_MODEL_SETUSERBUSINESSSTATUSREQUEST_H_ +#define ALIBABACLOUD_UBSMS_MODEL_SETUSERBUSINESSSTATUSREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Ubsms + { + namespace Model + { + class ALIBABACLOUD_UBSMS_EXPORT SetUserBusinessStatusRequest : public RpcServiceRequest + { + + public: + SetUserBusinessStatusRequest(); + ~SetUserBusinessStatusRequest(); + + std::string getUid()const; + void setUid(const std::string& uid); + std::string getStatusValue()const; + void setStatusValue(const std::string& statusValue); + std::string getService()const; + void setService(const std::string& service); + std::string getStatusKey()const; + void setStatusKey(const std::string& statusKey); + + private: + std::string uid_; + std::string statusValue_; + std::string service_; + std::string statusKey_; + + }; + } + } +} +#endif // !ALIBABACLOUD_UBSMS_MODEL_SETUSERBUSINESSSTATUSREQUEST_H_ \ No newline at end of file diff --git a/ubsms/include/alibabacloud/ubsms/model/SetUserBusinessStatusResult.h b/ubsms/include/alibabacloud/ubsms/model/SetUserBusinessStatusResult.h new file mode 100644 index 000000000..9c03a492e --- /dev/null +++ b/ubsms/include/alibabacloud/ubsms/model/SetUserBusinessStatusResult.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_UBSMS_MODEL_SETUSERBUSINESSSTATUSRESULT_H_ +#define ALIBABACLOUD_UBSMS_MODEL_SETUSERBUSINESSSTATUSRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Ubsms + { + namespace Model + { + class ALIBABACLOUD_UBSMS_EXPORT SetUserBusinessStatusResult : public ServiceResult + { + public: + + + SetUserBusinessStatusResult(); + explicit SetUserBusinessStatusResult(const std::string &payload); + ~SetUserBusinessStatusResult(); + bool getSuccess()const; + + protected: + void parse(const std::string &payload); + private: + bool success_; + + }; + } + } +} +#endif // !ALIBABACLOUD_UBSMS_MODEL_SETUSERBUSINESSSTATUSRESULT_H_ \ No newline at end of file diff --git a/ubsms/src/UbsmsClient.cc b/ubsms/src/UbsmsClient.cc new file mode 100644 index 000000000..dffc24aba --- /dev/null +++ b/ubsms/src/UbsmsClient.cc @@ -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 +#include + +using namespace AlibabaCloud; +using namespace AlibabaCloud::Location; +using namespace AlibabaCloud::Ubsms; +using namespace AlibabaCloud::Ubsms::Model; + +namespace +{ + const std::string SERVICE_NAME = "Ubsms"; +} + +UbsmsClient::UbsmsClient(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, "ubsms"); +} + +UbsmsClient::UbsmsClient(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, "ubsms"); +} + +UbsmsClient::UbsmsClient(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, "ubsms"); +} + +UbsmsClient::~UbsmsClient() +{} + +UbsmsClient::NotifyUserBusinessCommandOutcome UbsmsClient::notifyUserBusinessCommand(const NotifyUserBusinessCommandRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return NotifyUserBusinessCommandOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return NotifyUserBusinessCommandOutcome(NotifyUserBusinessCommandResult(outcome.result())); + else + return NotifyUserBusinessCommandOutcome(outcome.error()); +} + +void UbsmsClient::notifyUserBusinessCommandAsync(const NotifyUserBusinessCommandRequest& request, const NotifyUserBusinessCommandAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, notifyUserBusinessCommand(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +UbsmsClient::NotifyUserBusinessCommandOutcomeCallable UbsmsClient::notifyUserBusinessCommandCallable(const NotifyUserBusinessCommandRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->notifyUserBusinessCommand(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +UbsmsClient::DescribeBusinessStatusOutcome UbsmsClient::describeBusinessStatus(const DescribeBusinessStatusRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return DescribeBusinessStatusOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return DescribeBusinessStatusOutcome(DescribeBusinessStatusResult(outcome.result())); + else + return DescribeBusinessStatusOutcome(outcome.error()); +} + +void UbsmsClient::describeBusinessStatusAsync(const DescribeBusinessStatusRequest& request, const DescribeBusinessStatusAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, describeBusinessStatus(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +UbsmsClient::DescribeBusinessStatusOutcomeCallable UbsmsClient::describeBusinessStatusCallable(const DescribeBusinessStatusRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->describeBusinessStatus(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +UbsmsClient::SetUserBusinessStatusOutcome UbsmsClient::setUserBusinessStatus(const SetUserBusinessStatusRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return SetUserBusinessStatusOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return SetUserBusinessStatusOutcome(SetUserBusinessStatusResult(outcome.result())); + else + return SetUserBusinessStatusOutcome(outcome.error()); +} + +void UbsmsClient::setUserBusinessStatusAsync(const SetUserBusinessStatusRequest& request, const SetUserBusinessStatusAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, setUserBusinessStatus(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +UbsmsClient::SetUserBusinessStatusOutcomeCallable UbsmsClient::setUserBusinessStatusCallable(const SetUserBusinessStatusRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->setUserBusinessStatus(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + diff --git a/ubsms/src/model/DescribeBusinessStatusRequest.cc b/ubsms/src/model/DescribeBusinessStatusRequest.cc new file mode 100644 index 000000000..17f4e462d --- /dev/null +++ b/ubsms/src/model/DescribeBusinessStatusRequest.cc @@ -0,0 +1,49 @@ +/* + * 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::Ubsms::Model::DescribeBusinessStatusRequest; + +DescribeBusinessStatusRequest::DescribeBusinessStatusRequest() : + RpcServiceRequest("ubsms", "2015-06-23", "DescribeBusinessStatus") +{} + +DescribeBusinessStatusRequest::~DescribeBusinessStatusRequest() +{} + +std::string DescribeBusinessStatusRequest::getPassword()const +{ + return password_; +} + +void DescribeBusinessStatusRequest::setPassword(const std::string& password) +{ + password_ = password; + setParameter("Password", password); +} + +std::string DescribeBusinessStatusRequest::getCallerBid()const +{ + return callerBid_; +} + +void DescribeBusinessStatusRequest::setCallerBid(const std::string& callerBid) +{ + callerBid_ = callerBid; + setParameter("CallerBid", callerBid); +} + diff --git a/ubsms/src/model/DescribeBusinessStatusResult.cc b/ubsms/src/model/DescribeBusinessStatusResult.cc new file mode 100644 index 000000000..63cfde954 --- /dev/null +++ b/ubsms/src/model/DescribeBusinessStatusResult.cc @@ -0,0 +1,77 @@ +/* + * 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::Ubsms; +using namespace AlibabaCloud::Ubsms::Model; + +DescribeBusinessStatusResult::DescribeBusinessStatusResult() : + ServiceResult() +{} + +DescribeBusinessStatusResult::DescribeBusinessStatusResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +DescribeBusinessStatusResult::~DescribeBusinessStatusResult() +{} + +void DescribeBusinessStatusResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + + setRequestId(value["RequestId"].asString()); + auto allUserBusinessStatusList = value["UserBusinessStatusList"]["UserBusinessStatus"]; + for (auto value : allUserBusinessStatusList) + { + UserBusinessStatus userBusinessStatusListObject; + if(!value["Uid"].isNull()) + userBusinessStatusListObject.uid = value["Uid"].asString(); + if(!value["ServiceCode"].isNull()) + userBusinessStatusListObject.serviceCode = value["ServiceCode"].asString(); + auto allStatuses = value["Statuses"]["Status"]; + for (auto value : allStatuses) + { + UserBusinessStatus::Status statusesObject; + if(!value["StatusKey"].isNull()) + statusesObject.statusKey = value["StatusKey"].asString(); + if(!value["StatusValue"].isNull()) + statusesObject.statusValue = value["StatusValue"].asString(); + userBusinessStatusListObject.statuses.push_back(statusesObject); + } + userBusinessStatusList_.push_back(userBusinessStatusListObject); + } + if(!value["Success"].isNull()) + success_ = value["Success"].asString() == "true"; + +} + +std::vector DescribeBusinessStatusResult::getUserBusinessStatusList()const +{ + return userBusinessStatusList_; +} + +bool DescribeBusinessStatusResult::getSuccess()const +{ + return success_; +} + diff --git a/ubsms/src/model/NotifyUserBusinessCommandRequest.cc b/ubsms/src/model/NotifyUserBusinessCommandRequest.cc new file mode 100644 index 000000000..6639a6f1f --- /dev/null +++ b/ubsms/src/model/NotifyUserBusinessCommandRequest.cc @@ -0,0 +1,104 @@ +/* + * 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::Ubsms::Model::NotifyUserBusinessCommandRequest; + +NotifyUserBusinessCommandRequest::NotifyUserBusinessCommandRequest() : + RpcServiceRequest("ubsms", "2015-06-23", "NotifyUserBusinessCommand") +{} + +NotifyUserBusinessCommandRequest::~NotifyUserBusinessCommandRequest() +{} + +std::string NotifyUserBusinessCommandRequest::getUid()const +{ + return uid_; +} + +void NotifyUserBusinessCommandRequest::setUid(const std::string& uid) +{ + uid_ = uid; + setParameter("Uid", uid); +} + +std::string NotifyUserBusinessCommandRequest::getPassword()const +{ + return password_; +} + +void NotifyUserBusinessCommandRequest::setPassword(const std::string& password) +{ + password_ = password; + setParameter("Password", password); +} + +std::string NotifyUserBusinessCommandRequest::getInstanceId()const +{ + return instanceId_; +} + +void NotifyUserBusinessCommandRequest::setInstanceId(const std::string& instanceId) +{ + instanceId_ = instanceId; + setParameter("InstanceId", instanceId); +} + +std::string NotifyUserBusinessCommandRequest::getServiceCode()const +{ + return serviceCode_; +} + +void NotifyUserBusinessCommandRequest::setServiceCode(const std::string& serviceCode) +{ + serviceCode_ = serviceCode; + setParameter("ServiceCode", serviceCode); +} + +std::string NotifyUserBusinessCommandRequest::getClientToken()const +{ + return clientToken_; +} + +void NotifyUserBusinessCommandRequest::setClientToken(const std::string& clientToken) +{ + clientToken_ = clientToken; + setParameter("ClientToken", clientToken); +} + +std::string NotifyUserBusinessCommandRequest::getCmd()const +{ + return cmd_; +} + +void NotifyUserBusinessCommandRequest::setCmd(const std::string& cmd) +{ + cmd_ = cmd; + setParameter("Cmd", cmd); +} + +std::string NotifyUserBusinessCommandRequest::getRegion()const +{ + return region_; +} + +void NotifyUserBusinessCommandRequest::setRegion(const std::string& region) +{ + region_ = region; + setParameter("Region", region); +} + diff --git a/ubsms/src/model/NotifyUserBusinessCommandResult.cc b/ubsms/src/model/NotifyUserBusinessCommandResult.cc new file mode 100644 index 000000000..6bd9ec44a --- /dev/null +++ b/ubsms/src/model/NotifyUserBusinessCommandResult.cc @@ -0,0 +1,52 @@ +/* + * 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::Ubsms; +using namespace AlibabaCloud::Ubsms::Model; + +NotifyUserBusinessCommandResult::NotifyUserBusinessCommandResult() : + ServiceResult() +{} + +NotifyUserBusinessCommandResult::NotifyUserBusinessCommandResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +NotifyUserBusinessCommandResult::~NotifyUserBusinessCommandResult() +{} + +void NotifyUserBusinessCommandResult::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() == "true"; + +} + +bool NotifyUserBusinessCommandResult::getSuccess()const +{ + return success_; +} + diff --git a/ubsms/src/model/SetUserBusinessStatusRequest.cc b/ubsms/src/model/SetUserBusinessStatusRequest.cc new file mode 100644 index 000000000..2996aa227 --- /dev/null +++ b/ubsms/src/model/SetUserBusinessStatusRequest.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::Ubsms::Model::SetUserBusinessStatusRequest; + +SetUserBusinessStatusRequest::SetUserBusinessStatusRequest() : + RpcServiceRequest("ubsms", "2015-06-23", "SetUserBusinessStatus") +{} + +SetUserBusinessStatusRequest::~SetUserBusinessStatusRequest() +{} + +std::string SetUserBusinessStatusRequest::getUid()const +{ + return uid_; +} + +void SetUserBusinessStatusRequest::setUid(const std::string& uid) +{ + uid_ = uid; + setParameter("Uid", uid); +} + +std::string SetUserBusinessStatusRequest::getStatusValue()const +{ + return statusValue_; +} + +void SetUserBusinessStatusRequest::setStatusValue(const std::string& statusValue) +{ + statusValue_ = statusValue; + setParameter("StatusValue", statusValue); +} + +std::string SetUserBusinessStatusRequest::getService()const +{ + return service_; +} + +void SetUserBusinessStatusRequest::setService(const std::string& service) +{ + service_ = service; + setParameter("Service", service); +} + +std::string SetUserBusinessStatusRequest::getStatusKey()const +{ + return statusKey_; +} + +void SetUserBusinessStatusRequest::setStatusKey(const std::string& statusKey) +{ + statusKey_ = statusKey; + setParameter("StatusKey", statusKey); +} + diff --git a/ubsms/src/model/SetUserBusinessStatusResult.cc b/ubsms/src/model/SetUserBusinessStatusResult.cc new file mode 100644 index 000000000..347b3cc14 --- /dev/null +++ b/ubsms/src/model/SetUserBusinessStatusResult.cc @@ -0,0 +1,52 @@ +/* + * 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::Ubsms; +using namespace AlibabaCloud::Ubsms::Model; + +SetUserBusinessStatusResult::SetUserBusinessStatusResult() : + ServiceResult() +{} + +SetUserBusinessStatusResult::SetUserBusinessStatusResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +SetUserBusinessStatusResult::~SetUserBusinessStatusResult() +{} + +void SetUserBusinessStatusResult::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() == "true"; + +} + +bool SetUserBusinessStatusResult::getSuccess()const +{ + return success_; +} +