diff --git a/CHANGELOG b/CHANGELOG index 94b8713bd..efa5d3ca7 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,7 @@ +2020-09-25 Version: patch +- Public beta version. +- Add Api Overseas. + 2020-09-24 Version: patch - Support create for serverlesshbase. diff --git a/aliyuncvc/CMakeLists.txt b/aliyuncvc/CMakeLists.txt index 066fa98a2..ab2b5c53a 100644 --- a/aliyuncvc/CMakeLists.txt +++ b/aliyuncvc/CMakeLists.txt @@ -67,6 +67,8 @@ set(aliyuncvc_public_header_model include/alibabacloud/aliyuncvc/model/EndLiveResult.h include/alibabacloud/aliyuncvc/model/GetDeviceActiveCodeRequest.h include/alibabacloud/aliyuncvc/model/GetDeviceActiveCodeResult.h + include/alibabacloud/aliyuncvc/model/GetDeviceInfoRequest.h + include/alibabacloud/aliyuncvc/model/GetDeviceInfoResult.h include/alibabacloud/aliyuncvc/model/GetDeviceTokenRequest.h include/alibabacloud/aliyuncvc/model/GetDeviceTokenResult.h include/alibabacloud/aliyuncvc/model/GetMeetingRequest.h @@ -168,6 +170,8 @@ set(aliyuncvc_src src/model/EndLiveResult.cc src/model/GetDeviceActiveCodeRequest.cc src/model/GetDeviceActiveCodeResult.cc + src/model/GetDeviceInfoRequest.cc + src/model/GetDeviceInfoResult.cc src/model/GetDeviceTokenRequest.cc src/model/GetDeviceTokenResult.cc src/model/GetMeetingRequest.cc diff --git a/aliyuncvc/include/alibabacloud/aliyuncvc/AliyuncvcClient.h b/aliyuncvc/include/alibabacloud/aliyuncvc/AliyuncvcClient.h index 3db757b9e..0d73d233e 100644 --- a/aliyuncvc/include/alibabacloud/aliyuncvc/AliyuncvcClient.h +++ b/aliyuncvc/include/alibabacloud/aliyuncvc/AliyuncvcClient.h @@ -68,6 +68,8 @@ #include "model/EndLiveResult.h" #include "model/GetDeviceActiveCodeRequest.h" #include "model/GetDeviceActiveCodeResult.h" +#include "model/GetDeviceInfoRequest.h" +#include "model/GetDeviceInfoResult.h" #include "model/GetDeviceTokenRequest.h" #include "model/GetDeviceTokenResult.h" #include "model/GetMeetingRequest.h" @@ -198,6 +200,9 @@ namespace AlibabaCloud typedef Outcome GetDeviceActiveCodeOutcome; typedef std::future GetDeviceActiveCodeOutcomeCallable; typedef std::function&)> GetDeviceActiveCodeAsyncHandler; + typedef Outcome GetDeviceInfoOutcome; + typedef std::future GetDeviceInfoOutcomeCallable; + typedef std::function&)> GetDeviceInfoAsyncHandler; typedef Outcome GetDeviceTokenOutcome; typedef std::future GetDeviceTokenOutcomeCallable; typedef std::function&)> GetDeviceTokenAsyncHandler; @@ -350,6 +355,9 @@ namespace AlibabaCloud GetDeviceActiveCodeOutcome getDeviceActiveCode(const Model::GetDeviceActiveCodeRequest &request)const; void getDeviceActiveCodeAsync(const Model::GetDeviceActiveCodeRequest& request, const GetDeviceActiveCodeAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; GetDeviceActiveCodeOutcomeCallable getDeviceActiveCodeCallable(const Model::GetDeviceActiveCodeRequest& request) const; + GetDeviceInfoOutcome getDeviceInfo(const Model::GetDeviceInfoRequest &request)const; + void getDeviceInfoAsync(const Model::GetDeviceInfoRequest& request, const GetDeviceInfoAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + GetDeviceInfoOutcomeCallable getDeviceInfoCallable(const Model::GetDeviceInfoRequest& request) const; GetDeviceTokenOutcome getDeviceToken(const Model::GetDeviceTokenRequest &request)const; void getDeviceTokenAsync(const Model::GetDeviceTokenRequest& request, const GetDeviceTokenAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; GetDeviceTokenOutcomeCallable getDeviceTokenCallable(const Model::GetDeviceTokenRequest& request) const; diff --git a/aliyuncvc/include/alibabacloud/aliyuncvc/model/DeleteUserResult.h b/aliyuncvc/include/alibabacloud/aliyuncvc/model/DeleteUserResult.h index 5f45d54d4..0ae88ff52 100644 --- a/aliyuncvc/include/alibabacloud/aliyuncvc/model/DeleteUserResult.h +++ b/aliyuncvc/include/alibabacloud/aliyuncvc/model/DeleteUserResult.h @@ -39,14 +39,14 @@ namespace AlibabaCloud ~DeleteUserResult(); std::string getMessage()const; int getErrorCode()const; - std::string getSuccess()const; + bool getSuccess()const; protected: void parse(const std::string &payload); private: std::string message_; int errorCode_; - std::string success_; + bool success_; }; } diff --git a/aliyuncvc/include/alibabacloud/aliyuncvc/model/GetDeviceInfoRequest.h b/aliyuncvc/include/alibabacloud/aliyuncvc/model/GetDeviceInfoRequest.h new file mode 100644 index 000000000..54d1ed4cd --- /dev/null +++ b/aliyuncvc/include/alibabacloud/aliyuncvc/model/GetDeviceInfoRequest.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_ALIYUNCVC_MODEL_GETDEVICEINFOREQUEST_H_ +#define ALIBABACLOUD_ALIYUNCVC_MODEL_GETDEVICEINFOREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Aliyuncvc + { + namespace Model + { + class ALIBABACLOUD_ALIYUNCVC_EXPORT GetDeviceInfoRequest : public RpcServiceRequest + { + + public: + GetDeviceInfoRequest(); + ~GetDeviceInfoRequest(); + + std::string getCastScreenCode()const; + void setCastScreenCode(const std::string& castScreenCode); + + private: + std::string castScreenCode_; + + }; + } + } +} +#endif // !ALIBABACLOUD_ALIYUNCVC_MODEL_GETDEVICEINFOREQUEST_H_ \ No newline at end of file diff --git a/aliyuncvc/include/alibabacloud/aliyuncvc/model/GetDeviceInfoResult.h b/aliyuncvc/include/alibabacloud/aliyuncvc/model/GetDeviceInfoResult.h new file mode 100644 index 000000000..03a52fbfc --- /dev/null +++ b/aliyuncvc/include/alibabacloud/aliyuncvc/model/GetDeviceInfoResult.h @@ -0,0 +1,67 @@ +/* + * 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_ALIYUNCVC_MODEL_GETDEVICEINFORESULT_H_ +#define ALIBABACLOUD_ALIYUNCVC_MODEL_GETDEVICEINFORESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Aliyuncvc + { + namespace Model + { + class ALIBABACLOUD_ALIYUNCVC_EXPORT GetDeviceInfoResult : public ServiceResult + { + public: + struct Device + { + int status; + std::string castScreenCode; + std::string iP; + std::string sn; + std::string ssid; + std::string activationCode; + std::string mac; + }; + + + GetDeviceInfoResult(); + explicit GetDeviceInfoResult(const std::string &payload); + ~GetDeviceInfoResult(); + std::string getMessage()const; + Device getDevice()const; + int getErrorCode()const; + bool getSuccess()const; + + protected: + void parse(const std::string &payload); + private: + std::string message_; + Device device_; + int errorCode_; + bool success_; + + }; + } + } +} +#endif // !ALIBABACLOUD_ALIYUNCVC_MODEL_GETDEVICEINFORESULT_H_ \ No newline at end of file diff --git a/aliyuncvc/include/alibabacloud/aliyuncvc/model/RegisterUemDeviceRequest.h b/aliyuncvc/include/alibabacloud/aliyuncvc/model/RegisterUemDeviceRequest.h index bd9bf791f..f49d666ef 100644 --- a/aliyuncvc/include/alibabacloud/aliyuncvc/model/RegisterUemDeviceRequest.h +++ b/aliyuncvc/include/alibabacloud/aliyuncvc/model/RegisterUemDeviceRequest.h @@ -39,6 +39,8 @@ namespace AlibabaCloud void setIP(const std::string& iP); std::string getGroupId()const; void setGroupId(const std::string& groupId); + std::string getOwnerId()const; + void setOwnerId(const std::string& ownerId); std::string getDeviceId()const; void setDeviceId(const std::string& deviceId); std::string getGroupName()const; @@ -51,6 +53,7 @@ namespace AlibabaCloud private: std::string iP_; std::string groupId_; + std::string ownerId_; std::string deviceId_; std::string groupName_; std::string mac_; diff --git a/aliyuncvc/src/AliyuncvcClient.cc b/aliyuncvc/src/AliyuncvcClient.cc index d4968d2d7..bfe9e7b59 100644 --- a/aliyuncvc/src/AliyuncvcClient.cc +++ b/aliyuncvc/src/AliyuncvcClient.cc @@ -879,6 +879,42 @@ AliyuncvcClient::GetDeviceActiveCodeOutcomeCallable AliyuncvcClient::getDeviceAc return task->get_future(); } +AliyuncvcClient::GetDeviceInfoOutcome AliyuncvcClient::getDeviceInfo(const GetDeviceInfoRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return GetDeviceInfoOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return GetDeviceInfoOutcome(GetDeviceInfoResult(outcome.result())); + else + return GetDeviceInfoOutcome(outcome.error()); +} + +void AliyuncvcClient::getDeviceInfoAsync(const GetDeviceInfoRequest& request, const GetDeviceInfoAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, getDeviceInfo(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +AliyuncvcClient::GetDeviceInfoOutcomeCallable AliyuncvcClient::getDeviceInfoCallable(const GetDeviceInfoRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->getDeviceInfo(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + AliyuncvcClient::GetDeviceTokenOutcome AliyuncvcClient::getDeviceToken(const GetDeviceTokenRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); diff --git a/aliyuncvc/src/model/DeleteUserResult.cc b/aliyuncvc/src/model/DeleteUserResult.cc index 3323286a2..100b49294 100644 --- a/aliyuncvc/src/model/DeleteUserResult.cc +++ b/aliyuncvc/src/model/DeleteUserResult.cc @@ -40,7 +40,7 @@ void DeleteUserResult::parse(const std::string &payload) reader.parse(payload, value); setRequestId(value["RequestId"].asString()); if(!value["Success"].isNull()) - success_ = value["Success"].asString(); + success_ = value["Success"].asString() == "true"; if(!value["ErrorCode"].isNull()) errorCode_ = std::stoi(value["ErrorCode"].asString()); if(!value["Message"].isNull()) @@ -58,7 +58,7 @@ int DeleteUserResult::getErrorCode()const return errorCode_; } -std::string DeleteUserResult::getSuccess()const +bool DeleteUserResult::getSuccess()const { return success_; } diff --git a/aliyuncvc/src/model/GetDeviceInfoRequest.cc b/aliyuncvc/src/model/GetDeviceInfoRequest.cc new file mode 100644 index 000000000..efe9ace0b --- /dev/null +++ b/aliyuncvc/src/model/GetDeviceInfoRequest.cc @@ -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 + +using AlibabaCloud::Aliyuncvc::Model::GetDeviceInfoRequest; + +GetDeviceInfoRequest::GetDeviceInfoRequest() : + RpcServiceRequest("aliyuncvc", "2019-10-30", "GetDeviceInfo") +{ + setMethod(HttpRequest::Method::Post); +} + +GetDeviceInfoRequest::~GetDeviceInfoRequest() +{} + +std::string GetDeviceInfoRequest::getCastScreenCode()const +{ + return castScreenCode_; +} + +void GetDeviceInfoRequest::setCastScreenCode(const std::string& castScreenCode) +{ + castScreenCode_ = castScreenCode; + setBodyParameter("CastScreenCode", castScreenCode); +} + diff --git a/aliyuncvc/src/model/GetDeviceInfoResult.cc b/aliyuncvc/src/model/GetDeviceInfoResult.cc new file mode 100644 index 000000000..3652e1cc0 --- /dev/null +++ b/aliyuncvc/src/model/GetDeviceInfoResult.cc @@ -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 +#include + +using namespace AlibabaCloud::Aliyuncvc; +using namespace AlibabaCloud::Aliyuncvc::Model; + +GetDeviceInfoResult::GetDeviceInfoResult() : + ServiceResult() +{} + +GetDeviceInfoResult::GetDeviceInfoResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +GetDeviceInfoResult::~GetDeviceInfoResult() +{} + +void GetDeviceInfoResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto deviceNode = value["Device"]; + if(!deviceNode["ActivationCode"].isNull()) + device_.activationCode = deviceNode["ActivationCode"].asString(); + if(!deviceNode["CastScreenCode"].isNull()) + device_.castScreenCode = deviceNode["CastScreenCode"].asString(); + if(!deviceNode["Sn"].isNull()) + device_.sn = deviceNode["Sn"].asString(); + if(!deviceNode["Status"].isNull()) + device_.status = std::stoi(deviceNode["Status"].asString()); + if(!deviceNode["IP"].isNull()) + device_.iP = deviceNode["IP"].asString(); + if(!deviceNode["Mac"].isNull()) + device_.mac = deviceNode["Mac"].asString(); + if(!deviceNode["Ssid"].isNull()) + device_.ssid = deviceNode["Ssid"].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 GetDeviceInfoResult::getMessage()const +{ + return message_; +} + +GetDeviceInfoResult::Device GetDeviceInfoResult::getDevice()const +{ + return device_; +} + +int GetDeviceInfoResult::getErrorCode()const +{ + return errorCode_; +} + +bool GetDeviceInfoResult::getSuccess()const +{ + return success_; +} + diff --git a/aliyuncvc/src/model/RegisterUemDeviceRequest.cc b/aliyuncvc/src/model/RegisterUemDeviceRequest.cc index 7dc6ffdc9..c1bd27bb2 100644 --- a/aliyuncvc/src/model/RegisterUemDeviceRequest.cc +++ b/aliyuncvc/src/model/RegisterUemDeviceRequest.cc @@ -49,6 +49,17 @@ void RegisterUemDeviceRequest::setGroupId(const std::string& groupId) setParameter("GroupId", groupId); } +std::string RegisterUemDeviceRequest::getOwnerId()const +{ + return ownerId_; +} + +void RegisterUemDeviceRequest::setOwnerId(const std::string& ownerId) +{ + ownerId_ = ownerId; + setParameter("OwnerId", ownerId); +} + std::string RegisterUemDeviceRequest::getDeviceId()const { return deviceId_;