Public beta version.

This commit is contained in:
sdk-team
2020-06-17 14:30:20 +08:00
parent 39221a5319
commit 2df6079b2d
17 changed files with 892 additions and 1 deletions

View File

@@ -159,6 +159,78 @@ AliyuncvcClient::BatchCreateDeviceOutcomeCallable AliyuncvcClient::batchCreateDe
return task->get_future();
}
AliyuncvcClient::BatchDeleteDevicesOutcome AliyuncvcClient::batchDeleteDevices(const BatchDeleteDevicesRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return BatchDeleteDevicesOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return BatchDeleteDevicesOutcome(BatchDeleteDevicesResult(outcome.result()));
else
return BatchDeleteDevicesOutcome(outcome.error());
}
void AliyuncvcClient::batchDeleteDevicesAsync(const BatchDeleteDevicesRequest& request, const BatchDeleteDevicesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, batchDeleteDevices(request), context);
};
asyncExecute(new Runnable(fn));
}
AliyuncvcClient::BatchDeleteDevicesOutcomeCallable AliyuncvcClient::batchDeleteDevicesCallable(const BatchDeleteDevicesRequest &request) const
{
auto task = std::make_shared<std::packaged_task<BatchDeleteDevicesOutcome()>>(
[this, request]()
{
return this->batchDeleteDevices(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
AliyuncvcClient::CallDeviceOutcome AliyuncvcClient::callDevice(const CallDeviceRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return CallDeviceOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return CallDeviceOutcome(CallDeviceResult(outcome.result()));
else
return CallDeviceOutcome(outcome.error());
}
void AliyuncvcClient::callDeviceAsync(const CallDeviceRequest& request, const CallDeviceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, callDevice(request), context);
};
asyncExecute(new Runnable(fn));
}
AliyuncvcClient::CallDeviceOutcomeCallable AliyuncvcClient::callDeviceCallable(const CallDeviceRequest &request) const
{
auto task = std::make_shared<std::packaged_task<CallDeviceOutcome()>>(
[this, request]()
{
return this->callDevice(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
AliyuncvcClient::CreateDeviceMeetingOutcome AliyuncvcClient::createDeviceMeeting(const CreateDeviceMeetingRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -807,6 +879,42 @@ AliyuncvcClient::GetMeetingMemberOutcomeCallable AliyuncvcClient::getMeetingMemb
return task->get_future();
}
AliyuncvcClient::GetMembersOutcome AliyuncvcClient::getMembers(const GetMembersRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return GetMembersOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return GetMembersOutcome(GetMembersResult(outcome.result()));
else
return GetMembersOutcome(outcome.error());
}
void AliyuncvcClient::getMembersAsync(const GetMembersRequest& request, const GetMembersAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, getMembers(request), context);
};
asyncExecute(new Runnable(fn));
}
AliyuncvcClient::GetMembersOutcomeCallable AliyuncvcClient::getMembersCallable(const GetMembersRequest &request) const
{
auto task = std::make_shared<std::packaged_task<GetMembersOutcome()>>(
[this, request]()
{
return this->getMembers(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
AliyuncvcClient::GetUserOutcome AliyuncvcClient::getUser(const GetUserRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();

View 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/aliyuncvc/model/BatchDeleteDevicesRequest.h>
using AlibabaCloud::Aliyuncvc::Model::BatchDeleteDevicesRequest;
BatchDeleteDevicesRequest::BatchDeleteDevicesRequest() :
RpcServiceRequest("aliyuncvc", "2020-03-30", "BatchDeleteDevices")
{
setMethod(HttpRequest::Method::Post);
}
BatchDeleteDevicesRequest::~BatchDeleteDevicesRequest()
{}
std::string BatchDeleteDevicesRequest::getGroupId()const
{
return groupId_;
}
void BatchDeleteDevicesRequest::setGroupId(const std::string& groupId)
{
groupId_ = groupId;
setBodyParameter("GroupId", groupId);
}
std::string BatchDeleteDevicesRequest::getSN()const
{
return sN_;
}
void BatchDeleteDevicesRequest::setSN(const std::string& sN)
{
sN_ = sN;
setBodyParameter("SN", sN);
}

View 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/aliyuncvc/model/BatchDeleteDevicesResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Aliyuncvc;
using namespace AlibabaCloud::Aliyuncvc::Model;
BatchDeleteDevicesResult::BatchDeleteDevicesResult() :
ServiceResult()
{}
BatchDeleteDevicesResult::BatchDeleteDevicesResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
BatchDeleteDevicesResult::~BatchDeleteDevicesResult()
{}
void BatchDeleteDevicesResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
if(!value["ErrorCode"].isNull())
errorCode_ = std::stoi(value["ErrorCode"].asString());
if(!value["Message"].isNull())
message_ = value["Message"].asString();
if(!value["Success"].isNull())
success_ = value["Success"].asString() == "true";
}
std::string BatchDeleteDevicesResult::getMessage()const
{
return message_;
}
int BatchDeleteDevicesResult::getErrorCode()const
{
return errorCode_;
}
bool BatchDeleteDevicesResult::getSuccess()const
{
return success_;
}

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/aliyuncvc/model/CallDeviceRequest.h>
using AlibabaCloud::Aliyuncvc::Model::CallDeviceRequest;
CallDeviceRequest::CallDeviceRequest() :
RpcServiceRequest("aliyuncvc", "2019-10-30", "CallDevice")
{
setMethod(HttpRequest::Method::Post);
}
CallDeviceRequest::~CallDeviceRequest()
{}
std::string CallDeviceRequest::getOperateUserId()const
{
return operateUserId_;
}
void CallDeviceRequest::setOperateUserId(const std::string& operateUserId)
{
operateUserId_ = operateUserId;
setBodyParameter("OperateUserId", operateUserId);
}
bool CallDeviceRequest::getJoinMeetingFlag()const
{
return joinMeetingFlag_;
}
void CallDeviceRequest::setJoinMeetingFlag(bool joinMeetingFlag)
{
joinMeetingFlag_ = joinMeetingFlag;
setParameter("JoinMeetingFlag", joinMeetingFlag ? "true" : "false");
}
std::string CallDeviceRequest::getMeetingCode()const
{
return meetingCode_;
}
void CallDeviceRequest::setMeetingCode(const std::string& meetingCode)
{
meetingCode_ = meetingCode;
setBodyParameter("MeetingCode", meetingCode);
}
std::string CallDeviceRequest::getSN()const
{
return sN_;
}
void CallDeviceRequest::setSN(const std::string& sN)
{
sN_ = sN;
setBodyParameter("SN", sN);
}

View File

@@ -0,0 +1,72 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <alibabacloud/aliyuncvc/model/CallDeviceResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Aliyuncvc;
using namespace AlibabaCloud::Aliyuncvc::Model;
CallDeviceResult::CallDeviceResult() :
ServiceResult()
{}
CallDeviceResult::CallDeviceResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
CallDeviceResult::~CallDeviceResult()
{}
void CallDeviceResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
if(!value["ErrorCode"].isNull())
errorCode_ = std::stoi(value["ErrorCode"].asString());
if(!value["Message"].isNull())
message_ = value["Message"].asString();
if(!value["Success"].isNull())
success_ = value["Success"].asString() == "true";
if(!value["MessageId"].isNull())
messageId_ = value["MessageId"].asString();
}
std::string CallDeviceResult::getMessage()const
{
return message_;
}
int CallDeviceResult::getErrorCode()const
{
return errorCode_;
}
bool CallDeviceResult::getSuccess()const
{
return success_;
}
std::string CallDeviceResult::getMessageId()const
{
return messageId_;
}

View 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/aliyuncvc/model/GetMembersRequest.h>
using AlibabaCloud::Aliyuncvc::Model::GetMembersRequest;
GetMembersRequest::GetMembersRequest() :
RpcServiceRequest("aliyuncvc", "2020-03-30", "GetMembers")
{
setMethod(HttpRequest::Method::Post);
}
GetMembersRequest::~GetMembersRequest()
{}
std::string GetMembersRequest::getMeetingUUID()const
{
return meetingUUID_;
}
void GetMembersRequest::setMeetingUUID(const std::string& meetingUUID)
{
meetingUUID_ = meetingUUID;
setBodyParameter("MeetingUUID", meetingUUID);
}

View File

@@ -0,0 +1,99 @@
/*
* 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/aliyuncvc/model/GetMembersResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Aliyuncvc;
using namespace AlibabaCloud::Aliyuncvc::Model;
GetMembersResult::GetMembersResult() :
ServiceResult()
{}
GetMembersResult::GetMembersResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
GetMembersResult::~GetMembersResult()
{}
void GetMembersResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto meetingInfoNode = value["MeetingInfo"];
if(!meetingInfoNode["MeetingName"].isNull())
meetingInfo_.meetingName = meetingInfoNode["MeetingName"].asString();
if(!meetingInfoNode["ValidTime"].isNull())
meetingInfo_.validTime = std::stol(meetingInfoNode["ValidTime"].asString());
if(!meetingInfoNode["MeetingCode"].isNull())
meetingInfo_.meetingCode = meetingInfoNode["MeetingCode"].asString();
if(!meetingInfoNode["CreateTime"].isNull())
meetingInfo_.createTime = std::stol(meetingInfoNode["CreateTime"].asString());
if(!meetingInfoNode["UserId"].isNull())
meetingInfo_.userId = meetingInfoNode["UserId"].asString();
if(!meetingInfoNode["MeetingUUID"].isNull())
meetingInfo_.meetingUUID = meetingInfoNode["MeetingUUID"].asString();
auto allMemberListNode = meetingInfoNode["MemberList"]["MemberListItem"];
for (auto meetingInfoNodeMemberListMemberListItem : allMemberListNode)
{
MeetingInfo::MemberListItem memberListItemObject;
if(!meetingInfoNodeMemberListMemberListItem["UserAvatarUrl"].isNull())
memberListItemObject.userAvatarUrl = meetingInfoNodeMemberListMemberListItem["UserAvatarUrl"].asString();
if(!meetingInfoNodeMemberListMemberListItem["MemberUUID"].isNull())
memberListItemObject.memberUUID = meetingInfoNodeMemberListMemberListItem["MemberUUID"].asString();
if(!meetingInfoNodeMemberListMemberListItem["UserName"].isNull())
memberListItemObject.userName = meetingInfoNodeMemberListMemberListItem["UserName"].asString();
if(!meetingInfoNodeMemberListMemberListItem["UserId"].isNull())
memberListItemObject.userId = meetingInfoNodeMemberListMemberListItem["UserId"].asString();
if(!meetingInfoNodeMemberListMemberListItem["Status"].isNull())
memberListItemObject.status = meetingInfoNodeMemberListMemberListItem["Status"].asString();
meetingInfo_.memberList.push_back(memberListItemObject);
}
if(!value["ErrorCode"].isNull())
errorCode_ = std::stoi(value["ErrorCode"].asString());
if(!value["Message"].isNull())
message_ = value["Message"].asString();
if(!value["Success"].isNull())
success_ = value["Success"].asString() == "true";
}
GetMembersResult::MeetingInfo GetMembersResult::getMeetingInfo()const
{
return meetingInfo_;
}
std::string GetMembersResult::getMessage()const
{
return message_;
}
int GetMembersResult::getErrorCode()const
{
return errorCode_;
}
bool GetMembersResult::getSuccess()const
{
return success_;
}