MOPEN SDK Auto Released By everettli.ll,Version:1.20.4

Signed-off-by: yixiong.jxy <yixiong.jxy@alibaba-inc.com>
This commit is contained in:
yixiong.jxy
2018-08-01 00:50:16 +08:00
parent 076567c0c7
commit f6d7b208a9
47 changed files with 3183 additions and 2 deletions

413
mopen/src/MoPenClient.cc Normal file
View File

@@ -0,0 +1,413 @@
/*
* 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/mopen/MoPenClient.h>
#include <alibabacloud/core/SimpleCredentialsProvider.h>
using namespace AlibabaCloud;
using namespace AlibabaCloud::Location;
using namespace AlibabaCloud::MoPen;
using namespace AlibabaCloud::MoPen::Model;
namespace
{
const std::string SERVICE_NAME = "MoPen";
}
MoPenClient::MoPenClient(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, "");
}
MoPenClient::MoPenClient(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, "");
}
MoPenClient::MoPenClient(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, "");
}
MoPenClient::~MoPenClient()
{}
MoPenClient::MopenCreateGroupOutcome MoPenClient::mopenCreateGroup(const MopenCreateGroupRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return MopenCreateGroupOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return MopenCreateGroupOutcome(MopenCreateGroupResult(outcome.result()));
else
return MopenCreateGroupOutcome(outcome.error());
}
void MoPenClient::mopenCreateGroupAsync(const MopenCreateGroupRequest& request, const MopenCreateGroupAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, mopenCreateGroup(request), context);
};
asyncExecute(new Runnable(fn));
}
MoPenClient::MopenCreateGroupOutcomeCallable MoPenClient::mopenCreateGroupCallable(const MopenCreateGroupRequest &request) const
{
auto task = std::make_shared<std::packaged_task<MopenCreateGroupOutcome()>>(
[this, request]()
{
return this->mopenCreateGroup(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
MoPenClient::MoPenQueryCanvasOutcome MoPenClient::moPenQueryCanvas(const MoPenQueryCanvasRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return MoPenQueryCanvasOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return MoPenQueryCanvasOutcome(MoPenQueryCanvasResult(outcome.result()));
else
return MoPenQueryCanvasOutcome(outcome.error());
}
void MoPenClient::moPenQueryCanvasAsync(const MoPenQueryCanvasRequest& request, const MoPenQueryCanvasAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, moPenQueryCanvas(request), context);
};
asyncExecute(new Runnable(fn));
}
MoPenClient::MoPenQueryCanvasOutcomeCallable MoPenClient::moPenQueryCanvasCallable(const MoPenQueryCanvasRequest &request) const
{
auto task = std::make_shared<std::packaged_task<MoPenQueryCanvasOutcome()>>(
[this, request]()
{
return this->moPenQueryCanvas(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
MoPenClient::MoPenDeleteGroupMemberOutcome MoPenClient::moPenDeleteGroupMember(const MoPenDeleteGroupMemberRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return MoPenDeleteGroupMemberOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return MoPenDeleteGroupMemberOutcome(MoPenDeleteGroupMemberResult(outcome.result()));
else
return MoPenDeleteGroupMemberOutcome(outcome.error());
}
void MoPenClient::moPenDeleteGroupMemberAsync(const MoPenDeleteGroupMemberRequest& request, const MoPenDeleteGroupMemberAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, moPenDeleteGroupMember(request), context);
};
asyncExecute(new Runnable(fn));
}
MoPenClient::MoPenDeleteGroupMemberOutcomeCallable MoPenClient::moPenDeleteGroupMemberCallable(const MoPenDeleteGroupMemberRequest &request) const
{
auto task = std::make_shared<std::packaged_task<MoPenDeleteGroupMemberOutcome()>>(
[this, request]()
{
return this->moPenDeleteGroupMember(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
MoPenClient::MoPenDoRecognizeOutcome MoPenClient::moPenDoRecognize(const MoPenDoRecognizeRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return MoPenDoRecognizeOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return MoPenDoRecognizeOutcome(MoPenDoRecognizeResult(outcome.result()));
else
return MoPenDoRecognizeOutcome(outcome.error());
}
void MoPenClient::moPenDoRecognizeAsync(const MoPenDoRecognizeRequest& request, const MoPenDoRecognizeAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, moPenDoRecognize(request), context);
};
asyncExecute(new Runnable(fn));
}
MoPenClient::MoPenDoRecognizeOutcomeCallable MoPenClient::moPenDoRecognizeCallable(const MoPenDoRecognizeRequest &request) const
{
auto task = std::make_shared<std::packaged_task<MoPenDoRecognizeOutcome()>>(
[this, request]()
{
return this->moPenDoRecognize(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
MoPenClient::MoPenBindIsvOutcome MoPenClient::moPenBindIsv(const MoPenBindIsvRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return MoPenBindIsvOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return MoPenBindIsvOutcome(MoPenBindIsvResult(outcome.result()));
else
return MoPenBindIsvOutcome(outcome.error());
}
void MoPenClient::moPenBindIsvAsync(const MoPenBindIsvRequest& request, const MoPenBindIsvAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, moPenBindIsv(request), context);
};
asyncExecute(new Runnable(fn));
}
MoPenClient::MoPenBindIsvOutcomeCallable MoPenClient::moPenBindIsvCallable(const MoPenBindIsvRequest &request) const
{
auto task = std::make_shared<std::packaged_task<MoPenBindIsvOutcome()>>(
[this, request]()
{
return this->moPenBindIsv(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
MoPenClient::MoPenAddGroupMemberOutcome MoPenClient::moPenAddGroupMember(const MoPenAddGroupMemberRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return MoPenAddGroupMemberOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return MoPenAddGroupMemberOutcome(MoPenAddGroupMemberResult(outcome.result()));
else
return MoPenAddGroupMemberOutcome(outcome.error());
}
void MoPenClient::moPenAddGroupMemberAsync(const MoPenAddGroupMemberRequest& request, const MoPenAddGroupMemberAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, moPenAddGroupMember(request), context);
};
asyncExecute(new Runnable(fn));
}
MoPenClient::MoPenAddGroupMemberOutcomeCallable MoPenClient::moPenAddGroupMemberCallable(const MoPenAddGroupMemberRequest &request) const
{
auto task = std::make_shared<std::packaged_task<MoPenAddGroupMemberOutcome()>>(
[this, request]()
{
return this->moPenAddGroupMember(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
MoPenClient::MoPenCreateDeviceOutcome MoPenClient::moPenCreateDevice(const MoPenCreateDeviceRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return MoPenCreateDeviceOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return MoPenCreateDeviceOutcome(MoPenCreateDeviceResult(outcome.result()));
else
return MoPenCreateDeviceOutcome(outcome.error());
}
void MoPenClient::moPenCreateDeviceAsync(const MoPenCreateDeviceRequest& request, const MoPenCreateDeviceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, moPenCreateDevice(request), context);
};
asyncExecute(new Runnable(fn));
}
MoPenClient::MoPenCreateDeviceOutcomeCallable MoPenClient::moPenCreateDeviceCallable(const MoPenCreateDeviceRequest &request) const
{
auto task = std::make_shared<std::packaged_task<MoPenCreateDeviceOutcome()>>(
[this, request]()
{
return this->moPenCreateDevice(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
MoPenClient::MoPenSendMqttMessageOutcome MoPenClient::moPenSendMqttMessage(const MoPenSendMqttMessageRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return MoPenSendMqttMessageOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return MoPenSendMqttMessageOutcome(MoPenSendMqttMessageResult(outcome.result()));
else
return MoPenSendMqttMessageOutcome(outcome.error());
}
void MoPenClient::moPenSendMqttMessageAsync(const MoPenSendMqttMessageRequest& request, const MoPenSendMqttMessageAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, moPenSendMqttMessage(request), context);
};
asyncExecute(new Runnable(fn));
}
MoPenClient::MoPenSendMqttMessageOutcomeCallable MoPenClient::moPenSendMqttMessageCallable(const MoPenSendMqttMessageRequest &request) const
{
auto task = std::make_shared<std::packaged_task<MoPenSendMqttMessageOutcome()>>(
[this, request]()
{
return this->moPenSendMqttMessage(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
MoPenClient::MoPenFindGroupOutcome MoPenClient::moPenFindGroup(const MoPenFindGroupRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return MoPenFindGroupOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return MoPenFindGroupOutcome(MoPenFindGroupResult(outcome.result()));
else
return MoPenFindGroupOutcome(outcome.error());
}
void MoPenClient::moPenFindGroupAsync(const MoPenFindGroupRequest& request, const MoPenFindGroupAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, moPenFindGroup(request), context);
};
asyncExecute(new Runnable(fn));
}
MoPenClient::MoPenFindGroupOutcomeCallable MoPenClient::moPenFindGroupCallable(const MoPenFindGroupRequest &request) const
{
auto task = std::make_shared<std::packaged_task<MoPenFindGroupOutcome()>>(
[this, request]()
{
return this->moPenFindGroup(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
MoPenClient::MoPenDeleteGroupOutcome MoPenClient::moPenDeleteGroup(const MoPenDeleteGroupRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return MoPenDeleteGroupOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return MoPenDeleteGroupOutcome(MoPenDeleteGroupResult(outcome.result()));
else
return MoPenDeleteGroupOutcome(outcome.error());
}
void MoPenClient::moPenDeleteGroupAsync(const MoPenDeleteGroupRequest& request, const MoPenDeleteGroupAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, moPenDeleteGroup(request), context);
};
asyncExecute(new Runnable(fn));
}
MoPenClient::MoPenDeleteGroupOutcomeCallable MoPenClient::moPenDeleteGroupCallable(const MoPenDeleteGroupRequest &request) const
{
auto task = std::make_shared<std::packaged_task<MoPenDeleteGroupOutcome()>>(
[this, request]()
{
return this->moPenDeleteGroup(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}

View File

@@ -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 <alibabacloud/mopen/model/MoPenAddGroupMemberRequest.h>
using AlibabaCloud::MoPen::Model::MoPenAddGroupMemberRequest;
MoPenAddGroupMemberRequest::MoPenAddGroupMemberRequest() :
RpcServiceRequest("mopen", "2018-02-11", "MoPenAddGroupMember")
{}
MoPenAddGroupMemberRequest::~MoPenAddGroupMemberRequest()
{}
std::string MoPenAddGroupMemberRequest::getGroupId()const
{
return groupId_;
}
void MoPenAddGroupMemberRequest::setGroupId(const std::string& groupId)
{
groupId_ = groupId;
setParameter("GroupId", groupId);
}
std::string MoPenAddGroupMemberRequest::getDeviceName()const
{
return deviceName_;
}
void MoPenAddGroupMemberRequest::setDeviceName(const std::string& deviceName)
{
deviceName_ = deviceName;
setParameter("DeviceName", deviceName);
}

View 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/mopen/model/MoPenAddGroupMemberResult.h>
#include <json/json.h>
using namespace AlibabaCloud::MoPen;
using namespace AlibabaCloud::MoPen::Model;
MoPenAddGroupMemberResult::MoPenAddGroupMemberResult() :
ServiceResult()
{}
MoPenAddGroupMemberResult::MoPenAddGroupMemberResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
MoPenAddGroupMemberResult::~MoPenAddGroupMemberResult()
{}
void MoPenAddGroupMemberResult::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";
if(!value["Code"].isNull())
code_ = value["Code"].asString();
if(!value["Description"].isNull())
description_ = value["Description"].asString();
if(!value["Message"].isNull())
message_ = value["Message"].asString();
}
std::string MoPenAddGroupMemberResult::getDescription()const
{
return description_;
}
std::string MoPenAddGroupMemberResult::getMessage()const
{
return message_;
}
std::string MoPenAddGroupMemberResult::getCode()const
{
return code_;
}
bool MoPenAddGroupMemberResult::getSuccess()const
{
return success_;
}

View File

@@ -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 <alibabacloud/mopen/model/MoPenBindIsvRequest.h>
using AlibabaCloud::MoPen::Model::MoPenBindIsvRequest;
MoPenBindIsvRequest::MoPenBindIsvRequest() :
RpcServiceRequest("mopen", "2018-02-11", "MoPenBindIsv")
{}
MoPenBindIsvRequest::~MoPenBindIsvRequest()
{}
std::string MoPenBindIsvRequest::getOrderKey()const
{
return orderKey_;
}
void MoPenBindIsvRequest::setOrderKey(const std::string& orderKey)
{
orderKey_ = orderKey;
setParameter("OrderKey", orderKey);
}
std::string MoPenBindIsvRequest::getDeviceName()const
{
return deviceName_;
}
void MoPenBindIsvRequest::setDeviceName(const std::string& deviceName)
{
deviceName_ = deviceName;
setParameter("DeviceName", deviceName);
}

View 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/mopen/model/MoPenBindIsvResult.h>
#include <json/json.h>
using namespace AlibabaCloud::MoPen;
using namespace AlibabaCloud::MoPen::Model;
MoPenBindIsvResult::MoPenBindIsvResult() :
ServiceResult()
{}
MoPenBindIsvResult::MoPenBindIsvResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
MoPenBindIsvResult::~MoPenBindIsvResult()
{}
void MoPenBindIsvResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
if(!value["Code"].isNull())
code_ = value["Code"].asString() == "true";
if(!value["Message"].isNull())
message_ = value["Message"].asString();
if(!value["Success"].isNull())
success_ = value["Success"].asString() == "true";
if(!value["Description"].isNull())
description_ = value["Description"].asString();
}
std::string MoPenBindIsvResult::getDescription()const
{
return description_;
}
std::string MoPenBindIsvResult::getMessage()const
{
return message_;
}
bool MoPenBindIsvResult::getCode()const
{
return code_;
}
bool MoPenBindIsvResult::getSuccess()const
{
return success_;
}

View File

@@ -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 <alibabacloud/mopen/model/MoPenCreateDeviceRequest.h>
using AlibabaCloud::MoPen::Model::MoPenCreateDeviceRequest;
MoPenCreateDeviceRequest::MoPenCreateDeviceRequest() :
RpcServiceRequest("mopen", "2018-02-11", "MoPenCreateDevice")
{}
MoPenCreateDeviceRequest::~MoPenCreateDeviceRequest()
{}
std::string MoPenCreateDeviceRequest::getDeviceName()const
{
return deviceName_;
}
void MoPenCreateDeviceRequest::setDeviceName(const std::string& deviceName)
{
deviceName_ = deviceName;
setParameter("DeviceName", deviceName);
}
int MoPenCreateDeviceRequest::getDeviceType()const
{
return deviceType_;
}
void MoPenCreateDeviceRequest::setDeviceType(int deviceType)
{
deviceType_ = deviceType;
setParameter("DeviceType", std::to_string(deviceType));
}

View File

@@ -0,0 +1,85 @@
/*
* 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/mopen/model/MoPenCreateDeviceResult.h>
#include <json/json.h>
using namespace AlibabaCloud::MoPen;
using namespace AlibabaCloud::MoPen::Model;
MoPenCreateDeviceResult::MoPenCreateDeviceResult() :
ServiceResult()
{}
MoPenCreateDeviceResult::MoPenCreateDeviceResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
MoPenCreateDeviceResult::~MoPenCreateDeviceResult()
{}
void MoPenCreateDeviceResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto dataNode = value["Data"];
if(!dataNode["DeviceName"].isNull())
data_.deviceName = dataNode["DeviceName"].asString();
if(!dataNode["Product"].isNull())
data_.product = dataNode["Product"].asString();
if(!dataNode["DeviceSecret"].isNull())
data_.deviceSecret = dataNode["DeviceSecret"].asString();
if(!value["Code"].isNull())
code_ = value["Code"].asString() == "true";
if(!value["Message"].isNull())
message_ = value["Message"].asString();
if(!value["Success"].isNull())
success_ = value["Success"].asString() == "true";
if(!value["Description"].isNull())
description_ = value["Description"].asString();
}
std::string MoPenCreateDeviceResult::getDescription()const
{
return description_;
}
std::string MoPenCreateDeviceResult::getMessage()const
{
return message_;
}
MoPenCreateDeviceResult::Data MoPenCreateDeviceResult::getData()const
{
return data_;
}
bool MoPenCreateDeviceResult::getCode()const
{
return code_;
}
bool MoPenCreateDeviceResult::getSuccess()const
{
return success_;
}

View File

@@ -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 <alibabacloud/mopen/model/MoPenDeleteGroupMemberRequest.h>
using AlibabaCloud::MoPen::Model::MoPenDeleteGroupMemberRequest;
MoPenDeleteGroupMemberRequest::MoPenDeleteGroupMemberRequest() :
RpcServiceRequest("mopen", "2018-02-11", "MoPenDeleteGroupMember")
{}
MoPenDeleteGroupMemberRequest::~MoPenDeleteGroupMemberRequest()
{}
long MoPenDeleteGroupMemberRequest::getGroupId()const
{
return groupId_;
}
void MoPenDeleteGroupMemberRequest::setGroupId(long groupId)
{
groupId_ = groupId;
setParameter("GroupId", std::to_string(groupId));
}
std::string MoPenDeleteGroupMemberRequest::getDeviceName()const
{
return deviceName_;
}
void MoPenDeleteGroupMemberRequest::setDeviceName(const std::string& deviceName)
{
deviceName_ = deviceName;
setParameter("DeviceName", deviceName);
}

View 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/mopen/model/MoPenDeleteGroupMemberResult.h>
#include <json/json.h>
using namespace AlibabaCloud::MoPen;
using namespace AlibabaCloud::MoPen::Model;
MoPenDeleteGroupMemberResult::MoPenDeleteGroupMemberResult() :
ServiceResult()
{}
MoPenDeleteGroupMemberResult::MoPenDeleteGroupMemberResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
MoPenDeleteGroupMemberResult::~MoPenDeleteGroupMemberResult()
{}
void MoPenDeleteGroupMemberResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
if(!value["Code"].isNull())
code_ = value["Code"].asString();
if(!value["Success"].isNull())
success_ = value["Success"].asString() == "true";
if(!value["Description"].isNull())
description_ = value["Description"].asString();
if(!value["Message"].isNull())
message_ = value["Message"].asString();
}
std::string MoPenDeleteGroupMemberResult::getDescription()const
{
return description_;
}
std::string MoPenDeleteGroupMemberResult::getMessage()const
{
return message_;
}
std::string MoPenDeleteGroupMemberResult::getCode()const
{
return code_;
}
bool MoPenDeleteGroupMemberResult::getSuccess()const
{
return success_;
}

View File

@@ -0,0 +1,38 @@
/*
* 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/mopen/model/MoPenDeleteGroupRequest.h>
using AlibabaCloud::MoPen::Model::MoPenDeleteGroupRequest;
MoPenDeleteGroupRequest::MoPenDeleteGroupRequest() :
RpcServiceRequest("mopen", "2018-02-11", "MoPenDeleteGroup")
{}
MoPenDeleteGroupRequest::~MoPenDeleteGroupRequest()
{}
std::string MoPenDeleteGroupRequest::getGroupId()const
{
return groupId_;
}
void MoPenDeleteGroupRequest::setGroupId(const std::string& groupId)
{
groupId_ = groupId;
setParameter("GroupId", groupId);
}

View 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/mopen/model/MoPenDeleteGroupResult.h>
#include <json/json.h>
using namespace AlibabaCloud::MoPen;
using namespace AlibabaCloud::MoPen::Model;
MoPenDeleteGroupResult::MoPenDeleteGroupResult() :
ServiceResult()
{}
MoPenDeleteGroupResult::MoPenDeleteGroupResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
MoPenDeleteGroupResult::~MoPenDeleteGroupResult()
{}
void MoPenDeleteGroupResult::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";
if(!value["Code"].isNull())
code_ = value["Code"].asString();
if(!value["Message"].isNull())
message_ = value["Message"].asString();
if(!value["Description"].isNull())
description_ = value["Description"].asString();
}
std::string MoPenDeleteGroupResult::getDescription()const
{
return description_;
}
std::string MoPenDeleteGroupResult::getMessage()const
{
return message_;
}
std::string MoPenDeleteGroupResult::getCode()const
{
return code_;
}
bool MoPenDeleteGroupResult::getSuccess()const
{
return success_;
}

View File

@@ -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 <alibabacloud/mopen/model/MoPenDoRecognizeRequest.h>
using AlibabaCloud::MoPen::Model::MoPenDoRecognizeRequest;
MoPenDoRecognizeRequest::MoPenDoRecognizeRequest() :
RpcServiceRequest("mopen", "2018-02-11", "MoPenDoRecognize")
{}
MoPenDoRecognizeRequest::~MoPenDoRecognizeRequest()
{}
long MoPenDoRecognizeRequest::getCanvasId()const
{
return canvasId_;
}
void MoPenDoRecognizeRequest::setCanvasId(long canvasId)
{
canvasId_ = canvasId;
setParameter("CanvasId", std::to_string(canvasId));
}
int MoPenDoRecognizeRequest::getEndY()const
{
return endY_;
}
void MoPenDoRecognizeRequest::setEndY(int endY)
{
endY_ = endY;
setParameter("EndY", std::to_string(endY));
}
int MoPenDoRecognizeRequest::getEndX()const
{
return endX_;
}
void MoPenDoRecognizeRequest::setEndX(int endX)
{
endX_ = endX;
setParameter("EndX", std::to_string(endX));
}
std::string MoPenDoRecognizeRequest::getJsonConf()const
{
return jsonConf_;
}
void MoPenDoRecognizeRequest::setJsonConf(const std::string& jsonConf)
{
jsonConf_ = jsonConf;
setParameter("JsonConf", jsonConf);
}
std::string MoPenDoRecognizeRequest::getExportType()const
{
return exportType_;
}
void MoPenDoRecognizeRequest::setExportType(const std::string& exportType)
{
exportType_ = exportType;
setParameter("ExportType", exportType);
}
int MoPenDoRecognizeRequest::getStartY()const
{
return startY_;
}
void MoPenDoRecognizeRequest::setStartY(int startY)
{
startY_ = startY;
setParameter("StartY", std::to_string(startY));
}
int MoPenDoRecognizeRequest::getStartX()const
{
return startX_;
}
void MoPenDoRecognizeRequest::setStartX(int startX)
{
startX_ = startX;
setParameter("StartX", std::to_string(startX));
}

View File

@@ -0,0 +1,85 @@
/*
* 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/mopen/model/MoPenDoRecognizeResult.h>
#include <json/json.h>
using namespace AlibabaCloud::MoPen;
using namespace AlibabaCloud::MoPen::Model;
MoPenDoRecognizeResult::MoPenDoRecognizeResult() :
ServiceResult()
{}
MoPenDoRecognizeResult::MoPenDoRecognizeResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
MoPenDoRecognizeResult::~MoPenDoRecognizeResult()
{}
void MoPenDoRecognizeResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto dataNode = value["Data"];
if(!dataNode["Result"].isNull())
data_.result = dataNode["Result"].asString();
if(!dataNode["ResultType"].isNull())
data_.resultType = dataNode["ResultType"].asString();
if(!dataNode["CanvasId"].isNull())
data_.canvasId = std::stol(dataNode["CanvasId"].asString());
if(!value["Code"].isNull())
code_ = value["Code"].asString();
if(!value["Message"].isNull())
message_ = value["Message"].asString();
if(!value["Success"].isNull())
success_ = value["Success"].asString() == "true";
if(!value["Description"].isNull())
description_ = value["Description"].asString();
}
std::string MoPenDoRecognizeResult::getDescription()const
{
return description_;
}
std::string MoPenDoRecognizeResult::getMessage()const
{
return message_;
}
MoPenDoRecognizeResult::Data MoPenDoRecognizeResult::getData()const
{
return data_;
}
std::string MoPenDoRecognizeResult::getCode()const
{
return code_;
}
bool MoPenDoRecognizeResult::getSuccess()const
{
return success_;
}

View File

@@ -0,0 +1,38 @@
/*
* 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/mopen/model/MoPenFindGroupRequest.h>
using AlibabaCloud::MoPen::Model::MoPenFindGroupRequest;
MoPenFindGroupRequest::MoPenFindGroupRequest() :
RpcServiceRequest("mopen", "2018-02-11", "MoPenFindGroup")
{}
MoPenFindGroupRequest::~MoPenFindGroupRequest()
{}
std::string MoPenFindGroupRequest::getCreator()const
{
return creator_;
}
void MoPenFindGroupRequest::setCreator(const std::string& creator)
{
creator_ = creator;
setParameter("Creator", creator);
}

View File

@@ -0,0 +1,83 @@
/*
* 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/mopen/model/MoPenFindGroupResult.h>
#include <json/json.h>
using namespace AlibabaCloud::MoPen;
using namespace AlibabaCloud::MoPen::Model;
MoPenFindGroupResult::MoPenFindGroupResult() :
ServiceResult()
{}
MoPenFindGroupResult::MoPenFindGroupResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
MoPenFindGroupResult::~MoPenFindGroupResult()
{}
void MoPenFindGroupResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto dataNode = value["Data"];
if(!dataNode["GroupId"].isNull())
data_.groupId = dataNode["GroupId"].asString();
if(!dataNode["Creator"].isNull())
data_.creator = dataNode["Creator"].asString();
if(!value["Code"].isNull())
code_ = std::stoi(value["Code"].asString());
if(!value["Success"].isNull())
success_ = value["Success"].asString();
if(!value["Description"].isNull())
description_ = value["Description"].asString();
if(!value["Message"].isNull())
message_ = value["Message"].asString();
}
std::string MoPenFindGroupResult::getDescription()const
{
return description_;
}
std::string MoPenFindGroupResult::getMessage()const
{
return message_;
}
MoPenFindGroupResult::Data MoPenFindGroupResult::getData()const
{
return data_;
}
int MoPenFindGroupResult::getCode()const
{
return code_;
}
std::string MoPenFindGroupResult::getSuccess()const
{
return success_;
}

View File

@@ -0,0 +1,71 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <alibabacloud/mopen/model/MoPenQueryCanvasRequest.h>
using AlibabaCloud::MoPen::Model::MoPenQueryCanvasRequest;
MoPenQueryCanvasRequest::MoPenQueryCanvasRequest() :
RpcServiceRequest("mopen", "2018-02-11", "MoPenQueryCanvas")
{}
MoPenQueryCanvasRequest::~MoPenQueryCanvasRequest()
{}
std::string MoPenQueryCanvasRequest::getDeviceName()const
{
return deviceName_;
}
void MoPenQueryCanvasRequest::setDeviceName(const std::string& deviceName)
{
deviceName_ = deviceName;
setParameter("DeviceName", deviceName);
}
std::string MoPenQueryCanvasRequest::getSessionId()const
{
return sessionId_;
}
void MoPenQueryCanvasRequest::setSessionId(const std::string& sessionId)
{
sessionId_ = sessionId;
setParameter("SessionId", sessionId);
}
int MoPenQueryCanvasRequest::getPageId()const
{
return pageId_;
}
void MoPenQueryCanvasRequest::setPageId(int pageId)
{
pageId_ = pageId;
setParameter("PageId", std::to_string(pageId));
}
int MoPenQueryCanvasRequest::getStatus()const
{
return status_;
}
void MoPenQueryCanvasRequest::setStatus(int status)
{
status_ = status;
setParameter("Status", std::to_string(status));
}

View File

@@ -0,0 +1,103 @@
/*
* 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/mopen/model/MoPenQueryCanvasResult.h>
#include <json/json.h>
using namespace AlibabaCloud::MoPen;
using namespace AlibabaCloud::MoPen::Model;
MoPenQueryCanvasResult::MoPenQueryCanvasResult() :
ServiceResult()
{}
MoPenQueryCanvasResult::MoPenQueryCanvasResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
MoPenQueryCanvasResult::~MoPenQueryCanvasResult()
{}
void MoPenQueryCanvasResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto dataNode = value["Data"];
auto allCanvasList = value["CanvasList"]["Canvas"];
for (auto value : allCanvasList)
{
Data::Canvas canvasObject;
if(!value["Id"].isNull())
canvasObject.id = std::stol(value["Id"].asString());
if(!value["DeviceName"].isNull())
canvasObject.deviceName = value["DeviceName"].asString();
if(!value["Url"].isNull())
canvasObject.url = value["Url"].asString();
if(!value["PageId"].isNull())
canvasObject.pageId = std::stoi(value["PageId"].asString());
if(!value["SessionId"].isNull())
canvasObject.sessionId = value["SessionId"].asString();
if(!value["CreateTime"].isNull())
canvasObject.createTime = value["CreateTime"].asString();
if(!value["LastModified"].isNull())
canvasObject.lastModified = value["LastModified"].asString();
if(!value["Status"].isNull())
canvasObject.status = std::stoi(value["Status"].asString());
if(!value["Attribute"].isNull())
canvasObject.attribute = value["Attribute"].asString();
data_.canvasList.push_back(canvasObject);
}
if(!value["Code"].isNull())
code_ = value["Code"].asString();
if(!value["Message"].isNull())
message_ = value["Message"].asString();
if(!value["Success"].isNull())
success_ = value["Success"].asString() == "true";
if(!value["Description"].isNull())
description_ = value["Description"].asString();
}
std::string MoPenQueryCanvasResult::getDescription()const
{
return description_;
}
std::string MoPenQueryCanvasResult::getMessage()const
{
return message_;
}
MoPenQueryCanvasResult::Data MoPenQueryCanvasResult::getData()const
{
return data_;
}
std::string MoPenQueryCanvasResult::getCode()const
{
return code_;
}
bool MoPenQueryCanvasResult::getSuccess()const
{
return success_;
}

View File

@@ -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 <alibabacloud/mopen/model/MoPenSendMqttMessageRequest.h>
using AlibabaCloud::MoPen::Model::MoPenSendMqttMessageRequest;
MoPenSendMqttMessageRequest::MoPenSendMqttMessageRequest() :
RpcServiceRequest("mopen", "2018-02-11", "MoPenSendMqttMessage")
{}
MoPenSendMqttMessageRequest::~MoPenSendMqttMessageRequest()
{}
std::string MoPenSendMqttMessageRequest::getPayload()const
{
return payload_;
}
void MoPenSendMqttMessageRequest::setPayload(const std::string& payload)
{
payload_ = payload;
setParameter("Payload", payload);
}
std::string MoPenSendMqttMessageRequest::getDeviceName()const
{
return deviceName_;
}
void MoPenSendMqttMessageRequest::setDeviceName(const std::string& deviceName)
{
deviceName_ = deviceName;
setParameter("DeviceName", deviceName);
}

View 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/mopen/model/MoPenSendMqttMessageResult.h>
#include <json/json.h>
using namespace AlibabaCloud::MoPen;
using namespace AlibabaCloud::MoPen::Model;
MoPenSendMqttMessageResult::MoPenSendMqttMessageResult() :
ServiceResult()
{}
MoPenSendMqttMessageResult::MoPenSendMqttMessageResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
MoPenSendMqttMessageResult::~MoPenSendMqttMessageResult()
{}
void MoPenSendMqttMessageResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
if(!value["Code"].isNull())
code_ = value["Code"].asString();
if(!value["Message"].isNull())
message_ = value["Message"].asString();
if(!value["Success"].isNull())
success_ = value["Success"].asString() == "true";
if(!value["Description"].isNull())
description_ = value["Description"].asString();
}
std::string MoPenSendMqttMessageResult::getDescription()const
{
return description_;
}
std::string MoPenSendMqttMessageResult::getMessage()const
{
return message_;
}
std::string MoPenSendMqttMessageResult::getCode()const
{
return code_;
}
bool MoPenSendMqttMessageResult::getSuccess()const
{
return success_;
}

View File

@@ -0,0 +1,38 @@
/*
* 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/mopen/model/MopenCreateGroupRequest.h>
using AlibabaCloud::MoPen::Model::MopenCreateGroupRequest;
MopenCreateGroupRequest::MopenCreateGroupRequest() :
RpcServiceRequest("mopen", "2018-02-11", "MopenCreateGroup")
{}
MopenCreateGroupRequest::~MopenCreateGroupRequest()
{}
std::string MopenCreateGroupRequest::getCreator()const
{
return creator_;
}
void MopenCreateGroupRequest::setCreator(const std::string& creator)
{
creator_ = creator;
setParameter("Creator", creator);
}

View File

@@ -0,0 +1,88 @@
/*
* 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/mopen/model/MopenCreateGroupResult.h>
#include <json/json.h>
using namespace AlibabaCloud::MoPen;
using namespace AlibabaCloud::MoPen::Model;
MopenCreateGroupResult::MopenCreateGroupResult() :
ServiceResult()
{}
MopenCreateGroupResult::MopenCreateGroupResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
MopenCreateGroupResult::~MopenCreateGroupResult()
{}
void MopenCreateGroupResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto dataNode = value["Data"];
if(!dataNode["GroupId"].isNull())
data_.groupId = dataNode["GroupId"].asString();
if(!value["Code"].isNull())
code_ = std::stoi(value["Code"].asString());
if(!value["Success"].isNull())
success_ = value["Success"].asString();
if(!value["Description"].isNull())
description_ = value["Description"].asString();
if(!value["Message"].isNull())
message_ = value["Message"].asString();
if(!value["ResqusetId"].isNull())
resqusetId_ = value["ResqusetId"].asString();
}
std::string MopenCreateGroupResult::getResqusetId()const
{
return resqusetId_;
}
std::string MopenCreateGroupResult::getDescription()const
{
return description_;
}
std::string MopenCreateGroupResult::getMessage()const
{
return message_;
}
MopenCreateGroupResult::Data MopenCreateGroupResult::getData()const
{
return data_;
}
int MopenCreateGroupResult::getCode()const
{
return code_;
}
std::string MopenCreateGroupResult::getSuccess()const
{
return success_;
}