Support groupId operations.
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
2020-04-23 Version: 1.36.372
|
||||
- Support groupId operations.
|
||||
|
||||
2020-04-22 Version: 1.36.371
|
||||
- Generated 2019-01-01 for `Cassandra`.
|
||||
|
||||
|
||||
106
onsmqtt/CMakeLists.txt
Normal file
106
onsmqtt/CMakeLists.txt
Normal file
@@ -0,0 +1,106 @@
|
||||
#
|
||||
# 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(onsmqtt_public_header
|
||||
include/alibabacloud/onsmqtt/OnsMqttClient.h
|
||||
include/alibabacloud/onsmqtt/OnsMqttExport.h )
|
||||
|
||||
set(onsmqtt_public_header_model
|
||||
include/alibabacloud/onsmqtt/model/ApplyTokenRequest.h
|
||||
include/alibabacloud/onsmqtt/model/ApplyTokenResult.h
|
||||
include/alibabacloud/onsmqtt/model/CreateGroupIdRequest.h
|
||||
include/alibabacloud/onsmqtt/model/CreateGroupIdResult.h
|
||||
include/alibabacloud/onsmqtt/model/DeleteGroupIdRequest.h
|
||||
include/alibabacloud/onsmqtt/model/DeleteGroupIdResult.h
|
||||
include/alibabacloud/onsmqtt/model/ListGroupIdRequest.h
|
||||
include/alibabacloud/onsmqtt/model/ListGroupIdResult.h
|
||||
include/alibabacloud/onsmqtt/model/QueryTokenRequest.h
|
||||
include/alibabacloud/onsmqtt/model/QueryTokenResult.h
|
||||
include/alibabacloud/onsmqtt/model/RevokeTokenRequest.h
|
||||
include/alibabacloud/onsmqtt/model/RevokeTokenResult.h )
|
||||
|
||||
set(onsmqtt_src
|
||||
src/OnsMqttClient.cc
|
||||
src/model/ApplyTokenRequest.cc
|
||||
src/model/ApplyTokenResult.cc
|
||||
src/model/CreateGroupIdRequest.cc
|
||||
src/model/CreateGroupIdResult.cc
|
||||
src/model/DeleteGroupIdRequest.cc
|
||||
src/model/DeleteGroupIdResult.cc
|
||||
src/model/ListGroupIdRequest.cc
|
||||
src/model/ListGroupIdResult.cc
|
||||
src/model/QueryTokenRequest.cc
|
||||
src/model/QueryTokenResult.cc
|
||||
src/model/RevokeTokenRequest.cc
|
||||
src/model/RevokeTokenResult.cc )
|
||||
|
||||
add_library(onsmqtt ${LIB_TYPE}
|
||||
${onsmqtt_public_header}
|
||||
${onsmqtt_public_header_model}
|
||||
${onsmqtt_src})
|
||||
|
||||
set_target_properties(onsmqtt
|
||||
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}onsmqtt
|
||||
)
|
||||
|
||||
if(${LIB_TYPE} STREQUAL "SHARED")
|
||||
set_target_properties(onsmqtt
|
||||
PROPERTIES
|
||||
DEFINE_SYMBOL ALIBABACLOUD_ONSMQTT_LIBRARY)
|
||||
endif()
|
||||
|
||||
target_include_directories(onsmqtt
|
||||
PRIVATE include
|
||||
${CMAKE_SOURCE_DIR}/core/include
|
||||
)
|
||||
target_link_libraries(onsmqtt
|
||||
core)
|
||||
|
||||
if(CMAKE_HOST_WIN32)
|
||||
ExternalProject_Get_Property(jsoncpp INSTALL_DIR)
|
||||
set(jsoncpp_install_dir ${INSTALL_DIR})
|
||||
add_dependencies(onsmqtt
|
||||
jsoncpp)
|
||||
target_include_directories(onsmqtt
|
||||
PRIVATE ${jsoncpp_install_dir}/include)
|
||||
target_link_libraries(onsmqtt
|
||||
${jsoncpp_install_dir}/lib/jsoncpp.lib)
|
||||
set_target_properties(onsmqtt
|
||||
PROPERTIES
|
||||
COMPILE_OPTIONS "/bigobj")
|
||||
else()
|
||||
target_include_directories(onsmqtt
|
||||
PRIVATE /usr/include/jsoncpp)
|
||||
target_link_libraries(onsmqtt
|
||||
jsoncpp)
|
||||
endif()
|
||||
|
||||
install(FILES ${onsmqtt_public_header}
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/onsmqtt)
|
||||
install(FILES ${onsmqtt_public_header_model}
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/onsmqtt/model)
|
||||
install(TARGETS onsmqtt
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
)
|
||||
94
onsmqtt/include/alibabacloud/onsmqtt/OnsMqttClient.h
Normal file
94
onsmqtt/include/alibabacloud/onsmqtt/OnsMqttClient.h
Normal 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.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_ONSMQTT_ONSMQTTCLIENT_H_
|
||||
#define ALIBABACLOUD_ONSMQTT_ONSMQTTCLIENT_H_
|
||||
|
||||
#include <future>
|
||||
#include <alibabacloud/core/AsyncCallerContext.h>
|
||||
#include <alibabacloud/core/EndpointProvider.h>
|
||||
#include <alibabacloud/core/RpcServiceClient.h>
|
||||
#include "OnsMqttExport.h"
|
||||
#include "model/ApplyTokenRequest.h"
|
||||
#include "model/ApplyTokenResult.h"
|
||||
#include "model/CreateGroupIdRequest.h"
|
||||
#include "model/CreateGroupIdResult.h"
|
||||
#include "model/DeleteGroupIdRequest.h"
|
||||
#include "model/DeleteGroupIdResult.h"
|
||||
#include "model/ListGroupIdRequest.h"
|
||||
#include "model/ListGroupIdResult.h"
|
||||
#include "model/QueryTokenRequest.h"
|
||||
#include "model/QueryTokenResult.h"
|
||||
#include "model/RevokeTokenRequest.h"
|
||||
#include "model/RevokeTokenResult.h"
|
||||
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace OnsMqtt
|
||||
{
|
||||
class ALIBABACLOUD_ONSMQTT_EXPORT OnsMqttClient : public RpcServiceClient
|
||||
{
|
||||
public:
|
||||
typedef Outcome<Error, Model::ApplyTokenResult> ApplyTokenOutcome;
|
||||
typedef std::future<ApplyTokenOutcome> ApplyTokenOutcomeCallable;
|
||||
typedef std::function<void(const OnsMqttClient*, const Model::ApplyTokenRequest&, const ApplyTokenOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ApplyTokenAsyncHandler;
|
||||
typedef Outcome<Error, Model::CreateGroupIdResult> CreateGroupIdOutcome;
|
||||
typedef std::future<CreateGroupIdOutcome> CreateGroupIdOutcomeCallable;
|
||||
typedef std::function<void(const OnsMqttClient*, const Model::CreateGroupIdRequest&, const CreateGroupIdOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> CreateGroupIdAsyncHandler;
|
||||
typedef Outcome<Error, Model::DeleteGroupIdResult> DeleteGroupIdOutcome;
|
||||
typedef std::future<DeleteGroupIdOutcome> DeleteGroupIdOutcomeCallable;
|
||||
typedef std::function<void(const OnsMqttClient*, const Model::DeleteGroupIdRequest&, const DeleteGroupIdOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DeleteGroupIdAsyncHandler;
|
||||
typedef Outcome<Error, Model::ListGroupIdResult> ListGroupIdOutcome;
|
||||
typedef std::future<ListGroupIdOutcome> ListGroupIdOutcomeCallable;
|
||||
typedef std::function<void(const OnsMqttClient*, const Model::ListGroupIdRequest&, const ListGroupIdOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ListGroupIdAsyncHandler;
|
||||
typedef Outcome<Error, Model::QueryTokenResult> QueryTokenOutcome;
|
||||
typedef std::future<QueryTokenOutcome> QueryTokenOutcomeCallable;
|
||||
typedef std::function<void(const OnsMqttClient*, const Model::QueryTokenRequest&, const QueryTokenOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> QueryTokenAsyncHandler;
|
||||
typedef Outcome<Error, Model::RevokeTokenResult> RevokeTokenOutcome;
|
||||
typedef std::future<RevokeTokenOutcome> RevokeTokenOutcomeCallable;
|
||||
typedef std::function<void(const OnsMqttClient*, const Model::RevokeTokenRequest&, const RevokeTokenOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RevokeTokenAsyncHandler;
|
||||
|
||||
OnsMqttClient(const Credentials &credentials, const ClientConfiguration &configuration);
|
||||
OnsMqttClient(const std::shared_ptr<CredentialsProvider> &credentialsProvider, const ClientConfiguration &configuration);
|
||||
OnsMqttClient(const std::string &accessKeyId, const std::string &accessKeySecret, const ClientConfiguration &configuration);
|
||||
~OnsMqttClient();
|
||||
ApplyTokenOutcome applyToken(const Model::ApplyTokenRequest &request)const;
|
||||
void applyTokenAsync(const Model::ApplyTokenRequest& request, const ApplyTokenAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
ApplyTokenOutcomeCallable applyTokenCallable(const Model::ApplyTokenRequest& request) const;
|
||||
CreateGroupIdOutcome createGroupId(const Model::CreateGroupIdRequest &request)const;
|
||||
void createGroupIdAsync(const Model::CreateGroupIdRequest& request, const CreateGroupIdAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
CreateGroupIdOutcomeCallable createGroupIdCallable(const Model::CreateGroupIdRequest& request) const;
|
||||
DeleteGroupIdOutcome deleteGroupId(const Model::DeleteGroupIdRequest &request)const;
|
||||
void deleteGroupIdAsync(const Model::DeleteGroupIdRequest& request, const DeleteGroupIdAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
DeleteGroupIdOutcomeCallable deleteGroupIdCallable(const Model::DeleteGroupIdRequest& request) const;
|
||||
ListGroupIdOutcome listGroupId(const Model::ListGroupIdRequest &request)const;
|
||||
void listGroupIdAsync(const Model::ListGroupIdRequest& request, const ListGroupIdAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
ListGroupIdOutcomeCallable listGroupIdCallable(const Model::ListGroupIdRequest& request) const;
|
||||
QueryTokenOutcome queryToken(const Model::QueryTokenRequest &request)const;
|
||||
void queryTokenAsync(const Model::QueryTokenRequest& request, const QueryTokenAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
QueryTokenOutcomeCallable queryTokenCallable(const Model::QueryTokenRequest& request) const;
|
||||
RevokeTokenOutcome revokeToken(const Model::RevokeTokenRequest &request)const;
|
||||
void revokeTokenAsync(const Model::RevokeTokenRequest& request, const RevokeTokenAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
RevokeTokenOutcomeCallable revokeTokenCallable(const Model::RevokeTokenRequest& request) const;
|
||||
|
||||
private:
|
||||
std::shared_ptr<EndpointProvider> endpointProvider_;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !ALIBABACLOUD_ONSMQTT_ONSMQTTCLIENT_H_
|
||||
32
onsmqtt/include/alibabacloud/onsmqtt/OnsMqttExport.h
Normal file
32
onsmqtt/include/alibabacloud/onsmqtt/OnsMqttExport.h
Normal 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_ONSMQTT_ONSMQTTEXPORT_H_
|
||||
#define ALIBABACLOUD_ONSMQTT_ONSMQTTEXPORT_H_
|
||||
|
||||
#include <alibabacloud/core/Global.h>
|
||||
|
||||
#if defined(ALIBABACLOUD_SHARED)
|
||||
# if defined(ALIBABACLOUD_ONSMQTT_LIBRARY)
|
||||
# define ALIBABACLOUD_ONSMQTT_EXPORT ALIBABACLOUD_DECL_EXPORT
|
||||
# else
|
||||
# define ALIBABACLOUD_ONSMQTT_EXPORT ALIBABACLOUD_DECL_IMPORT
|
||||
# endif
|
||||
#else
|
||||
# define ALIBABACLOUD_ONSMQTT_EXPORT
|
||||
#endif
|
||||
|
||||
#endif // !ALIBABACLOUD_ONSMQTT_ONSMQTTEXPORT_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_ONSMQTT_MODEL_APPLYTOKENREQUEST_H_
|
||||
#define ALIBABACLOUD_ONSMQTT_MODEL_APPLYTOKENREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/onsmqtt/OnsMqttExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace OnsMqtt
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_ONSMQTT_EXPORT ApplyTokenRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
ApplyTokenRequest();
|
||||
~ApplyTokenRequest();
|
||||
|
||||
long getExpireTime()const;
|
||||
void setExpireTime(long expireTime);
|
||||
std::string getResources()const;
|
||||
void setResources(const std::string& resources);
|
||||
std::string getInstanceId()const;
|
||||
void setInstanceId(const std::string& instanceId);
|
||||
std::string getActions()const;
|
||||
void setActions(const std::string& actions);
|
||||
|
||||
private:
|
||||
long expireTime_;
|
||||
std::string resources_;
|
||||
std::string instanceId_;
|
||||
std::string actions_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_ONSMQTT_MODEL_APPLYTOKENREQUEST_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_ONSMQTT_MODEL_APPLYTOKENRESULT_H_
|
||||
#define ALIBABACLOUD_ONSMQTT_MODEL_APPLYTOKENRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/onsmqtt/OnsMqttExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace OnsMqtt
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_ONSMQTT_EXPORT ApplyTokenResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
ApplyTokenResult();
|
||||
explicit ApplyTokenResult(const std::string &payload);
|
||||
~ApplyTokenResult();
|
||||
std::string getToken()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::string token_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_ONSMQTT_MODEL_APPLYTOKENRESULT_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_ONSMQTT_MODEL_CREATEGROUPIDREQUEST_H_
|
||||
#define ALIBABACLOUD_ONSMQTT_MODEL_CREATEGROUPIDREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/onsmqtt/OnsMqttExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace OnsMqtt
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_ONSMQTT_EXPORT CreateGroupIdRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
CreateGroupIdRequest();
|
||||
~CreateGroupIdRequest();
|
||||
|
||||
std::string getGroupId()const;
|
||||
void setGroupId(const std::string& groupId);
|
||||
std::string getInstanceId()const;
|
||||
void setInstanceId(const std::string& instanceId);
|
||||
|
||||
private:
|
||||
std::string groupId_;
|
||||
std::string instanceId_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_ONSMQTT_MODEL_CREATEGROUPIDREQUEST_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_ONSMQTT_MODEL_CREATEGROUPIDRESULT_H_
|
||||
#define ALIBABACLOUD_ONSMQTT_MODEL_CREATEGROUPIDRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/onsmqtt/OnsMqttExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace OnsMqtt
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_ONSMQTT_EXPORT CreateGroupIdResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
CreateGroupIdResult();
|
||||
explicit CreateGroupIdResult(const std::string &payload);
|
||||
~CreateGroupIdResult();
|
||||
std::string getHelpUrl()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::string helpUrl_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_ONSMQTT_MODEL_CREATEGROUPIDRESULT_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_ONSMQTT_MODEL_DELETEGROUPIDREQUEST_H_
|
||||
#define ALIBABACLOUD_ONSMQTT_MODEL_DELETEGROUPIDREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/onsmqtt/OnsMqttExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace OnsMqtt
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_ONSMQTT_EXPORT DeleteGroupIdRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
DeleteGroupIdRequest();
|
||||
~DeleteGroupIdRequest();
|
||||
|
||||
std::string getGroupId()const;
|
||||
void setGroupId(const std::string& groupId);
|
||||
std::string getInstanceId()const;
|
||||
void setInstanceId(const std::string& instanceId);
|
||||
|
||||
private:
|
||||
std::string groupId_;
|
||||
std::string instanceId_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_ONSMQTT_MODEL_DELETEGROUPIDREQUEST_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_ONSMQTT_MODEL_DELETEGROUPIDRESULT_H_
|
||||
#define ALIBABACLOUD_ONSMQTT_MODEL_DELETEGROUPIDRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/onsmqtt/OnsMqttExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace OnsMqtt
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_ONSMQTT_EXPORT DeleteGroupIdResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
DeleteGroupIdResult();
|
||||
explicit DeleteGroupIdResult(const std::string &payload);
|
||||
~DeleteGroupIdResult();
|
||||
std::string getHelpUrl()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::string helpUrl_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_ONSMQTT_MODEL_DELETEGROUPIDRESULT_H_
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* 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_ONSMQTT_MODEL_LISTGROUPIDREQUEST_H_
|
||||
#define ALIBABACLOUD_ONSMQTT_MODEL_LISTGROUPIDREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/onsmqtt/OnsMqttExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace OnsMqtt
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_ONSMQTT_EXPORT ListGroupIdRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
ListGroupIdRequest();
|
||||
~ListGroupIdRequest();
|
||||
|
||||
std::string getInstanceId()const;
|
||||
void setInstanceId(const std::string& instanceId);
|
||||
|
||||
private:
|
||||
std::string instanceId_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_ONSMQTT_MODEL_LISTGROUPIDREQUEST_H_
|
||||
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* 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_ONSMQTT_MODEL_LISTGROUPIDRESULT_H_
|
||||
#define ALIBABACLOUD_ONSMQTT_MODEL_LISTGROUPIDRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/onsmqtt/OnsMqttExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace OnsMqtt
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_ONSMQTT_EXPORT ListGroupIdResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct MqttGroupIdDo
|
||||
{
|
||||
std::string instanceId;
|
||||
long createTime;
|
||||
long updateTime;
|
||||
bool independentNaming;
|
||||
std::string groupId;
|
||||
};
|
||||
|
||||
|
||||
ListGroupIdResult();
|
||||
explicit ListGroupIdResult(const std::string &payload);
|
||||
~ListGroupIdResult();
|
||||
std::vector<MqttGroupIdDo> getData()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::vector<MqttGroupIdDo> data_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_ONSMQTT_MODEL_LISTGROUPIDRESULT_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_ONSMQTT_MODEL_QUERYTOKENREQUEST_H_
|
||||
#define ALIBABACLOUD_ONSMQTT_MODEL_QUERYTOKENREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/onsmqtt/OnsMqttExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace OnsMqtt
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_ONSMQTT_EXPORT QueryTokenRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
QueryTokenRequest();
|
||||
~QueryTokenRequest();
|
||||
|
||||
std::string getToken()const;
|
||||
void setToken(const std::string& token);
|
||||
std::string getInstanceId()const;
|
||||
void setInstanceId(const std::string& instanceId);
|
||||
|
||||
private:
|
||||
std::string token_;
|
||||
std::string instanceId_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_ONSMQTT_MODEL_QUERYTOKENREQUEST_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_ONSMQTT_MODEL_QUERYTOKENRESULT_H_
|
||||
#define ALIBABACLOUD_ONSMQTT_MODEL_QUERYTOKENRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/onsmqtt/OnsMqttExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace OnsMqtt
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_ONSMQTT_EXPORT QueryTokenResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
QueryTokenResult();
|
||||
explicit QueryTokenResult(const std::string &payload);
|
||||
~QueryTokenResult();
|
||||
bool getTokenStatus()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
bool tokenStatus_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_ONSMQTT_MODEL_QUERYTOKENRESULT_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_ONSMQTT_MODEL_REVOKETOKENREQUEST_H_
|
||||
#define ALIBABACLOUD_ONSMQTT_MODEL_REVOKETOKENREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/onsmqtt/OnsMqttExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace OnsMqtt
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_ONSMQTT_EXPORT RevokeTokenRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
RevokeTokenRequest();
|
||||
~RevokeTokenRequest();
|
||||
|
||||
std::string getToken()const;
|
||||
void setToken(const std::string& token);
|
||||
std::string getInstanceId()const;
|
||||
void setInstanceId(const std::string& instanceId);
|
||||
|
||||
private:
|
||||
std::string token_;
|
||||
std::string instanceId_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_ONSMQTT_MODEL_REVOKETOKENREQUEST_H_
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_ONSMQTT_MODEL_REVOKETOKENRESULT_H_
|
||||
#define ALIBABACLOUD_ONSMQTT_MODEL_REVOKETOKENRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/onsmqtt/OnsMqttExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace OnsMqtt
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_ONSMQTT_EXPORT RevokeTokenResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
RevokeTokenResult();
|
||||
explicit RevokeTokenResult(const std::string &payload);
|
||||
~RevokeTokenResult();
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_ONSMQTT_MODEL_REVOKETOKENRESULT_H_
|
||||
269
onsmqtt/src/OnsMqttClient.cc
Normal file
269
onsmqtt/src/OnsMqttClient.cc
Normal file
@@ -0,0 +1,269 @@
|
||||
/*
|
||||
* 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/onsmqtt/OnsMqttClient.h>
|
||||
#include <alibabacloud/core/SimpleCredentialsProvider.h>
|
||||
|
||||
using namespace AlibabaCloud;
|
||||
using namespace AlibabaCloud::Location;
|
||||
using namespace AlibabaCloud::OnsMqtt;
|
||||
using namespace AlibabaCloud::OnsMqtt::Model;
|
||||
|
||||
namespace
|
||||
{
|
||||
const std::string SERVICE_NAME = "OnsMqtt";
|
||||
}
|
||||
|
||||
OnsMqttClient::OnsMqttClient(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, "");
|
||||
}
|
||||
|
||||
OnsMqttClient::OnsMqttClient(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, "");
|
||||
}
|
||||
|
||||
OnsMqttClient::OnsMqttClient(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, "");
|
||||
}
|
||||
|
||||
OnsMqttClient::~OnsMqttClient()
|
||||
{}
|
||||
|
||||
OnsMqttClient::ApplyTokenOutcome OnsMqttClient::applyToken(const ApplyTokenRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return ApplyTokenOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return ApplyTokenOutcome(ApplyTokenResult(outcome.result()));
|
||||
else
|
||||
return ApplyTokenOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void OnsMqttClient::applyTokenAsync(const ApplyTokenRequest& request, const ApplyTokenAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, applyToken(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
OnsMqttClient::ApplyTokenOutcomeCallable OnsMqttClient::applyTokenCallable(const ApplyTokenRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<ApplyTokenOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->applyToken(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
OnsMqttClient::CreateGroupIdOutcome OnsMqttClient::createGroupId(const CreateGroupIdRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return CreateGroupIdOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return CreateGroupIdOutcome(CreateGroupIdResult(outcome.result()));
|
||||
else
|
||||
return CreateGroupIdOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void OnsMqttClient::createGroupIdAsync(const CreateGroupIdRequest& request, const CreateGroupIdAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, createGroupId(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
OnsMqttClient::CreateGroupIdOutcomeCallable OnsMqttClient::createGroupIdCallable(const CreateGroupIdRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<CreateGroupIdOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->createGroupId(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
OnsMqttClient::DeleteGroupIdOutcome OnsMqttClient::deleteGroupId(const DeleteGroupIdRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return DeleteGroupIdOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return DeleteGroupIdOutcome(DeleteGroupIdResult(outcome.result()));
|
||||
else
|
||||
return DeleteGroupIdOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void OnsMqttClient::deleteGroupIdAsync(const DeleteGroupIdRequest& request, const DeleteGroupIdAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, deleteGroupId(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
OnsMqttClient::DeleteGroupIdOutcomeCallable OnsMqttClient::deleteGroupIdCallable(const DeleteGroupIdRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<DeleteGroupIdOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->deleteGroupId(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
OnsMqttClient::ListGroupIdOutcome OnsMqttClient::listGroupId(const ListGroupIdRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return ListGroupIdOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return ListGroupIdOutcome(ListGroupIdResult(outcome.result()));
|
||||
else
|
||||
return ListGroupIdOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void OnsMqttClient::listGroupIdAsync(const ListGroupIdRequest& request, const ListGroupIdAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, listGroupId(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
OnsMqttClient::ListGroupIdOutcomeCallable OnsMqttClient::listGroupIdCallable(const ListGroupIdRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<ListGroupIdOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->listGroupId(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
OnsMqttClient::QueryTokenOutcome OnsMqttClient::queryToken(const QueryTokenRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return QueryTokenOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return QueryTokenOutcome(QueryTokenResult(outcome.result()));
|
||||
else
|
||||
return QueryTokenOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void OnsMqttClient::queryTokenAsync(const QueryTokenRequest& request, const QueryTokenAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, queryToken(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
OnsMqttClient::QueryTokenOutcomeCallable OnsMqttClient::queryTokenCallable(const QueryTokenRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<QueryTokenOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->queryToken(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
OnsMqttClient::RevokeTokenOutcome OnsMqttClient::revokeToken(const RevokeTokenRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return RevokeTokenOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return RevokeTokenOutcome(RevokeTokenResult(outcome.result()));
|
||||
else
|
||||
return RevokeTokenOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void OnsMqttClient::revokeTokenAsync(const RevokeTokenRequest& request, const RevokeTokenAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, revokeToken(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
OnsMqttClient::RevokeTokenOutcomeCallable OnsMqttClient::revokeTokenCallable(const RevokeTokenRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<RevokeTokenOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->revokeToken(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
73
onsmqtt/src/model/ApplyTokenRequest.cc
Normal file
73
onsmqtt/src/model/ApplyTokenRequest.cc
Normal file
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* 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/onsmqtt/model/ApplyTokenRequest.h>
|
||||
|
||||
using AlibabaCloud::OnsMqtt::Model::ApplyTokenRequest;
|
||||
|
||||
ApplyTokenRequest::ApplyTokenRequest() :
|
||||
RpcServiceRequest("onsmqtt", "2020-04-20", "ApplyToken")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
ApplyTokenRequest::~ApplyTokenRequest()
|
||||
{}
|
||||
|
||||
long ApplyTokenRequest::getExpireTime()const
|
||||
{
|
||||
return expireTime_;
|
||||
}
|
||||
|
||||
void ApplyTokenRequest::setExpireTime(long expireTime)
|
||||
{
|
||||
expireTime_ = expireTime;
|
||||
setParameter("ExpireTime", std::to_string(expireTime));
|
||||
}
|
||||
|
||||
std::string ApplyTokenRequest::getResources()const
|
||||
{
|
||||
return resources_;
|
||||
}
|
||||
|
||||
void ApplyTokenRequest::setResources(const std::string& resources)
|
||||
{
|
||||
resources_ = resources;
|
||||
setParameter("Resources", resources);
|
||||
}
|
||||
|
||||
std::string ApplyTokenRequest::getInstanceId()const
|
||||
{
|
||||
return instanceId_;
|
||||
}
|
||||
|
||||
void ApplyTokenRequest::setInstanceId(const std::string& instanceId)
|
||||
{
|
||||
instanceId_ = instanceId;
|
||||
setParameter("InstanceId", instanceId);
|
||||
}
|
||||
|
||||
std::string ApplyTokenRequest::getActions()const
|
||||
{
|
||||
return actions_;
|
||||
}
|
||||
|
||||
void ApplyTokenRequest::setActions(const std::string& actions)
|
||||
{
|
||||
actions_ = actions;
|
||||
setParameter("Actions", actions);
|
||||
}
|
||||
|
||||
51
onsmqtt/src/model/ApplyTokenResult.cc
Normal file
51
onsmqtt/src/model/ApplyTokenResult.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/onsmqtt/model/ApplyTokenResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::OnsMqtt;
|
||||
using namespace AlibabaCloud::OnsMqtt::Model;
|
||||
|
||||
ApplyTokenResult::ApplyTokenResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
ApplyTokenResult::ApplyTokenResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
ApplyTokenResult::~ApplyTokenResult()
|
||||
{}
|
||||
|
||||
void ApplyTokenResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["Token"].isNull())
|
||||
token_ = value["Token"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string ApplyTokenResult::getToken()const
|
||||
{
|
||||
return token_;
|
||||
}
|
||||
|
||||
51
onsmqtt/src/model/CreateGroupIdRequest.cc
Normal file
51
onsmqtt/src/model/CreateGroupIdRequest.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/onsmqtt/model/CreateGroupIdRequest.h>
|
||||
|
||||
using AlibabaCloud::OnsMqtt::Model::CreateGroupIdRequest;
|
||||
|
||||
CreateGroupIdRequest::CreateGroupIdRequest() :
|
||||
RpcServiceRequest("onsmqtt", "2020-04-20", "CreateGroupId")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
CreateGroupIdRequest::~CreateGroupIdRequest()
|
||||
{}
|
||||
|
||||
std::string CreateGroupIdRequest::getGroupId()const
|
||||
{
|
||||
return groupId_;
|
||||
}
|
||||
|
||||
void CreateGroupIdRequest::setGroupId(const std::string& groupId)
|
||||
{
|
||||
groupId_ = groupId;
|
||||
setParameter("GroupId", groupId);
|
||||
}
|
||||
|
||||
std::string CreateGroupIdRequest::getInstanceId()const
|
||||
{
|
||||
return instanceId_;
|
||||
}
|
||||
|
||||
void CreateGroupIdRequest::setInstanceId(const std::string& instanceId)
|
||||
{
|
||||
instanceId_ = instanceId;
|
||||
setParameter("InstanceId", instanceId);
|
||||
}
|
||||
|
||||
51
onsmqtt/src/model/CreateGroupIdResult.cc
Normal file
51
onsmqtt/src/model/CreateGroupIdResult.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/onsmqtt/model/CreateGroupIdResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::OnsMqtt;
|
||||
using namespace AlibabaCloud::OnsMqtt::Model;
|
||||
|
||||
CreateGroupIdResult::CreateGroupIdResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
CreateGroupIdResult::CreateGroupIdResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
CreateGroupIdResult::~CreateGroupIdResult()
|
||||
{}
|
||||
|
||||
void CreateGroupIdResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["HelpUrl"].isNull())
|
||||
helpUrl_ = value["HelpUrl"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string CreateGroupIdResult::getHelpUrl()const
|
||||
{
|
||||
return helpUrl_;
|
||||
}
|
||||
|
||||
51
onsmqtt/src/model/DeleteGroupIdRequest.cc
Normal file
51
onsmqtt/src/model/DeleteGroupIdRequest.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/onsmqtt/model/DeleteGroupIdRequest.h>
|
||||
|
||||
using AlibabaCloud::OnsMqtt::Model::DeleteGroupIdRequest;
|
||||
|
||||
DeleteGroupIdRequest::DeleteGroupIdRequest() :
|
||||
RpcServiceRequest("onsmqtt", "2020-04-20", "DeleteGroupId")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
DeleteGroupIdRequest::~DeleteGroupIdRequest()
|
||||
{}
|
||||
|
||||
std::string DeleteGroupIdRequest::getGroupId()const
|
||||
{
|
||||
return groupId_;
|
||||
}
|
||||
|
||||
void DeleteGroupIdRequest::setGroupId(const std::string& groupId)
|
||||
{
|
||||
groupId_ = groupId;
|
||||
setParameter("GroupId", groupId);
|
||||
}
|
||||
|
||||
std::string DeleteGroupIdRequest::getInstanceId()const
|
||||
{
|
||||
return instanceId_;
|
||||
}
|
||||
|
||||
void DeleteGroupIdRequest::setInstanceId(const std::string& instanceId)
|
||||
{
|
||||
instanceId_ = instanceId;
|
||||
setParameter("InstanceId", instanceId);
|
||||
}
|
||||
|
||||
51
onsmqtt/src/model/DeleteGroupIdResult.cc
Normal file
51
onsmqtt/src/model/DeleteGroupIdResult.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/onsmqtt/model/DeleteGroupIdResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::OnsMqtt;
|
||||
using namespace AlibabaCloud::OnsMqtt::Model;
|
||||
|
||||
DeleteGroupIdResult::DeleteGroupIdResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
DeleteGroupIdResult::DeleteGroupIdResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
DeleteGroupIdResult::~DeleteGroupIdResult()
|
||||
{}
|
||||
|
||||
void DeleteGroupIdResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["HelpUrl"].isNull())
|
||||
helpUrl_ = value["HelpUrl"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string DeleteGroupIdResult::getHelpUrl()const
|
||||
{
|
||||
return helpUrl_;
|
||||
}
|
||||
|
||||
40
onsmqtt/src/model/ListGroupIdRequest.cc
Normal file
40
onsmqtt/src/model/ListGroupIdRequest.cc
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* 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/onsmqtt/model/ListGroupIdRequest.h>
|
||||
|
||||
using AlibabaCloud::OnsMqtt::Model::ListGroupIdRequest;
|
||||
|
||||
ListGroupIdRequest::ListGroupIdRequest() :
|
||||
RpcServiceRequest("onsmqtt", "2020-04-20", "ListGroupId")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
ListGroupIdRequest::~ListGroupIdRequest()
|
||||
{}
|
||||
|
||||
std::string ListGroupIdRequest::getInstanceId()const
|
||||
{
|
||||
return instanceId_;
|
||||
}
|
||||
|
||||
void ListGroupIdRequest::setInstanceId(const std::string& instanceId)
|
||||
{
|
||||
instanceId_ = instanceId;
|
||||
setParameter("InstanceId", instanceId);
|
||||
}
|
||||
|
||||
65
onsmqtt/src/model/ListGroupIdResult.cc
Normal file
65
onsmqtt/src/model/ListGroupIdResult.cc
Normal file
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* 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/onsmqtt/model/ListGroupIdResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::OnsMqtt;
|
||||
using namespace AlibabaCloud::OnsMqtt::Model;
|
||||
|
||||
ListGroupIdResult::ListGroupIdResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
ListGroupIdResult::ListGroupIdResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
ListGroupIdResult::~ListGroupIdResult()
|
||||
{}
|
||||
|
||||
void ListGroupIdResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto allDataNode = value["Data"]["MqttGroupIdDo"];
|
||||
for (auto valueDataMqttGroupIdDo : allDataNode)
|
||||
{
|
||||
MqttGroupIdDo dataObject;
|
||||
if(!valueDataMqttGroupIdDo["CreateTime"].isNull())
|
||||
dataObject.createTime = std::stol(valueDataMqttGroupIdDo["CreateTime"].asString());
|
||||
if(!valueDataMqttGroupIdDo["GroupId"].isNull())
|
||||
dataObject.groupId = valueDataMqttGroupIdDo["GroupId"].asString();
|
||||
if(!valueDataMqttGroupIdDo["IndependentNaming"].isNull())
|
||||
dataObject.independentNaming = valueDataMqttGroupIdDo["IndependentNaming"].asString() == "true";
|
||||
if(!valueDataMqttGroupIdDo["InstanceId"].isNull())
|
||||
dataObject.instanceId = valueDataMqttGroupIdDo["InstanceId"].asString();
|
||||
if(!valueDataMqttGroupIdDo["UpdateTime"].isNull())
|
||||
dataObject.updateTime = std::stol(valueDataMqttGroupIdDo["UpdateTime"].asString());
|
||||
data_.push_back(dataObject);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
std::vector<ListGroupIdResult::MqttGroupIdDo> ListGroupIdResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
51
onsmqtt/src/model/QueryTokenRequest.cc
Normal file
51
onsmqtt/src/model/QueryTokenRequest.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/onsmqtt/model/QueryTokenRequest.h>
|
||||
|
||||
using AlibabaCloud::OnsMqtt::Model::QueryTokenRequest;
|
||||
|
||||
QueryTokenRequest::QueryTokenRequest() :
|
||||
RpcServiceRequest("onsmqtt", "2020-04-20", "QueryToken")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
QueryTokenRequest::~QueryTokenRequest()
|
||||
{}
|
||||
|
||||
std::string QueryTokenRequest::getToken()const
|
||||
{
|
||||
return token_;
|
||||
}
|
||||
|
||||
void QueryTokenRequest::setToken(const std::string& token)
|
||||
{
|
||||
token_ = token;
|
||||
setParameter("Token", token);
|
||||
}
|
||||
|
||||
std::string QueryTokenRequest::getInstanceId()const
|
||||
{
|
||||
return instanceId_;
|
||||
}
|
||||
|
||||
void QueryTokenRequest::setInstanceId(const std::string& instanceId)
|
||||
{
|
||||
instanceId_ = instanceId;
|
||||
setParameter("InstanceId", instanceId);
|
||||
}
|
||||
|
||||
51
onsmqtt/src/model/QueryTokenResult.cc
Normal file
51
onsmqtt/src/model/QueryTokenResult.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/onsmqtt/model/QueryTokenResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::OnsMqtt;
|
||||
using namespace AlibabaCloud::OnsMqtt::Model;
|
||||
|
||||
QueryTokenResult::QueryTokenResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
QueryTokenResult::QueryTokenResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
QueryTokenResult::~QueryTokenResult()
|
||||
{}
|
||||
|
||||
void QueryTokenResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["TokenStatus"].isNull())
|
||||
tokenStatus_ = value["TokenStatus"].asString() == "true";
|
||||
|
||||
}
|
||||
|
||||
bool QueryTokenResult::getTokenStatus()const
|
||||
{
|
||||
return tokenStatus_;
|
||||
}
|
||||
|
||||
51
onsmqtt/src/model/RevokeTokenRequest.cc
Normal file
51
onsmqtt/src/model/RevokeTokenRequest.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/onsmqtt/model/RevokeTokenRequest.h>
|
||||
|
||||
using AlibabaCloud::OnsMqtt::Model::RevokeTokenRequest;
|
||||
|
||||
RevokeTokenRequest::RevokeTokenRequest() :
|
||||
RpcServiceRequest("onsmqtt", "2020-04-20", "RevokeToken")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
RevokeTokenRequest::~RevokeTokenRequest()
|
||||
{}
|
||||
|
||||
std::string RevokeTokenRequest::getToken()const
|
||||
{
|
||||
return token_;
|
||||
}
|
||||
|
||||
void RevokeTokenRequest::setToken(const std::string& token)
|
||||
{
|
||||
token_ = token;
|
||||
setParameter("Token", token);
|
||||
}
|
||||
|
||||
std::string RevokeTokenRequest::getInstanceId()const
|
||||
{
|
||||
return instanceId_;
|
||||
}
|
||||
|
||||
void RevokeTokenRequest::setInstanceId(const std::string& instanceId)
|
||||
{
|
||||
instanceId_ = instanceId;
|
||||
setParameter("InstanceId", instanceId);
|
||||
}
|
||||
|
||||
44
onsmqtt/src/model/RevokeTokenResult.cc
Normal file
44
onsmqtt/src/model/RevokeTokenResult.cc
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* 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/onsmqtt/model/RevokeTokenResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::OnsMqtt;
|
||||
using namespace AlibabaCloud::OnsMqtt::Model;
|
||||
|
||||
RevokeTokenResult::RevokeTokenResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
RevokeTokenResult::RevokeTokenResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
RevokeTokenResult::~RevokeTokenResult()
|
||||
{}
|
||||
|
||||
void RevokeTokenResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user