diff --git a/VERSION b/VERSION index b71310259..2d2b8b22a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.1254 \ No newline at end of file +1.36.1255 \ No newline at end of file diff --git a/quickbi-public/CMakeLists.txt b/quickbi-public/CMakeLists.txt index 171d277c6..9d1cc970f 100644 --- a/quickbi-public/CMakeLists.txt +++ b/quickbi-public/CMakeLists.txt @@ -41,6 +41,8 @@ set(quickbi-public_public_header_model include/alibabacloud/quickbi-public/model/AddWorkspaceUsersResult.h include/alibabacloud/quickbi-public/model/AuthorizeMenuRequest.h include/alibabacloud/quickbi-public/model/AuthorizeMenuResult.h + include/alibabacloud/quickbi-public/model/BatchAddFeishuUsersRequest.h + include/alibabacloud/quickbi-public/model/BatchAddFeishuUsersResult.h include/alibabacloud/quickbi-public/model/CancelAuthorizationMenuRequest.h include/alibabacloud/quickbi-public/model/CancelAuthorizationMenuResult.h include/alibabacloud/quickbi-public/model/CancelCollectionRequest.h @@ -200,6 +202,8 @@ set(quickbi-public_src src/model/AddWorkspaceUsersResult.cc src/model/AuthorizeMenuRequest.cc src/model/AuthorizeMenuResult.cc + src/model/BatchAddFeishuUsersRequest.cc + src/model/BatchAddFeishuUsersResult.cc src/model/CancelAuthorizationMenuRequest.cc src/model/CancelAuthorizationMenuResult.cc src/model/CancelCollectionRequest.cc diff --git a/quickbi-public/include/alibabacloud/quickbi-public/Quickbi_publicClient.h b/quickbi-public/include/alibabacloud/quickbi-public/Quickbi_publicClient.h index ad3d165eb..e7c2b85f0 100644 --- a/quickbi-public/include/alibabacloud/quickbi-public/Quickbi_publicClient.h +++ b/quickbi-public/include/alibabacloud/quickbi-public/Quickbi_publicClient.h @@ -42,6 +42,8 @@ #include "model/AddWorkspaceUsersResult.h" #include "model/AuthorizeMenuRequest.h" #include "model/AuthorizeMenuResult.h" +#include "model/BatchAddFeishuUsersRequest.h" +#include "model/BatchAddFeishuUsersResult.h" #include "model/CancelAuthorizationMenuRequest.h" #include "model/CancelAuthorizationMenuResult.h" #include "model/CancelCollectionRequest.h" @@ -217,6 +219,9 @@ namespace AlibabaCloud typedef Outcome AuthorizeMenuOutcome; typedef std::future AuthorizeMenuOutcomeCallable; typedef std::function&)> AuthorizeMenuAsyncHandler; + typedef Outcome BatchAddFeishuUsersOutcome; + typedef std::future BatchAddFeishuUsersOutcomeCallable; + typedef std::function&)> BatchAddFeishuUsersAsyncHandler; typedef Outcome CancelAuthorizationMenuOutcome; typedef std::future CancelAuthorizationMenuOutcomeCallable; typedef std::function&)> CancelAuthorizationMenuAsyncHandler; @@ -456,6 +461,9 @@ namespace AlibabaCloud AuthorizeMenuOutcome authorizeMenu(const Model::AuthorizeMenuRequest &request)const; void authorizeMenuAsync(const Model::AuthorizeMenuRequest& request, const AuthorizeMenuAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; AuthorizeMenuOutcomeCallable authorizeMenuCallable(const Model::AuthorizeMenuRequest& request) const; + BatchAddFeishuUsersOutcome batchAddFeishuUsers(const Model::BatchAddFeishuUsersRequest &request)const; + void batchAddFeishuUsersAsync(const Model::BatchAddFeishuUsersRequest& request, const BatchAddFeishuUsersAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + BatchAddFeishuUsersOutcomeCallable batchAddFeishuUsersCallable(const Model::BatchAddFeishuUsersRequest& request) const; CancelAuthorizationMenuOutcome cancelAuthorizationMenu(const Model::CancelAuthorizationMenuRequest &request)const; void cancelAuthorizationMenuAsync(const Model::CancelAuthorizationMenuRequest& request, const CancelAuthorizationMenuAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; CancelAuthorizationMenuOutcomeCallable cancelAuthorizationMenuCallable(const Model::CancelAuthorizationMenuRequest& request) const; diff --git a/quickbi-public/include/alibabacloud/quickbi-public/model/BatchAddFeishuUsersRequest.h b/quickbi-public/include/alibabacloud/quickbi-public/model/BatchAddFeishuUsersRequest.h new file mode 100644 index 000000000..e7eea9230 --- /dev/null +++ b/quickbi-public/include/alibabacloud/quickbi-public/model/BatchAddFeishuUsersRequest.h @@ -0,0 +1,60 @@ +/* + * 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_QUICKBI_PUBLIC_MODEL_BATCHADDFEISHUUSERSREQUEST_H_ +#define ALIBABACLOUD_QUICKBI_PUBLIC_MODEL_BATCHADDFEISHUUSERSREQUEST_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud { +namespace Quickbi_public { +namespace Model { +class ALIBABACLOUD_QUICKBI_PUBLIC_EXPORT BatchAddFeishuUsersRequest : public RpcServiceRequest { +public: + BatchAddFeishuUsersRequest(); + ~BatchAddFeishuUsersRequest(); + bool getIsAdmin() const; + void setIsAdmin(bool isAdmin); + std::string getFeishuUsers() const; + void setFeishuUsers(const std::string &feishuUsers); + std::string getAccessPoint() const; + void setAccessPoint(const std::string &accessPoint); + int getUserType() const; + void setUserType(int userType); + std::string getSignType() const; + void setSignType(const std::string &signType); + std::string getUserGroupIds() const; + void setUserGroupIds(const std::string &userGroupIds); + bool getIsAuthAdmin() const; + void setIsAuthAdmin(bool isAuthAdmin); + +private: + bool isAdmin_; + std::string feishuUsers_; + std::string accessPoint_; + int userType_; + std::string signType_; + std::string userGroupIds_; + bool isAuthAdmin_; +}; +} // namespace Model +} // namespace Quickbi_public +} // namespace AlibabaCloud +#endif // !ALIBABACLOUD_QUICKBI_PUBLIC_MODEL_BATCHADDFEISHUUSERSREQUEST_H_ diff --git a/quickbi-public/include/alibabacloud/quickbi-public/model/BatchAddFeishuUsersResult.h b/quickbi-public/include/alibabacloud/quickbi-public/model/BatchAddFeishuUsersResult.h new file mode 100644 index 000000000..e0d42c9b0 --- /dev/null +++ b/quickbi-public/include/alibabacloud/quickbi-public/model/BatchAddFeishuUsersResult.h @@ -0,0 +1,69 @@ +/* + * 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_QUICKBI_PUBLIC_MODEL_BATCHADDFEISHUUSERSRESULT_H_ +#define ALIBABACLOUD_QUICKBI_PUBLIC_MODEL_BATCHADDFEISHUUSERSRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Quickbi_public + { + namespace Model + { + class ALIBABACLOUD_QUICKBI_PUBLIC_EXPORT BatchAddFeishuUsersResult : public ServiceResult + { + public: + struct Result + { + struct FailResultsItem + { + struct FailInfosItem + { + std::string input; + std::string codeDesc; + std::string code; + }; + std::vector failInfos; + }; + int okCount; + int failCount; + std::vector failResults; + }; + + + BatchAddFeishuUsersResult(); + explicit BatchAddFeishuUsersResult(const std::string &payload); + ~BatchAddFeishuUsersResult(); + bool getSuccess()const; + Result getResult()const; + + protected: + void parse(const std::string &payload); + private: + bool success_; + Result result_; + + }; + } + } +} +#endif // !ALIBABACLOUD_QUICKBI_PUBLIC_MODEL_BATCHADDFEISHUUSERSRESULT_H_ \ No newline at end of file diff --git a/quickbi-public/src/Quickbi-publicClient.cc b/quickbi-public/src/Quickbi-publicClient.cc index 59112fd98..63d25cc1a 100644 --- a/quickbi-public/src/Quickbi-publicClient.cc +++ b/quickbi-public/src/Quickbi-publicClient.cc @@ -411,6 +411,42 @@ Quickbi_publicClient::AuthorizeMenuOutcomeCallable Quickbi_publicClient::authori return task->get_future(); } +Quickbi_publicClient::BatchAddFeishuUsersOutcome Quickbi_publicClient::batchAddFeishuUsers(const BatchAddFeishuUsersRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return BatchAddFeishuUsersOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return BatchAddFeishuUsersOutcome(BatchAddFeishuUsersResult(outcome.result())); + else + return BatchAddFeishuUsersOutcome(outcome.error()); +} + +void Quickbi_publicClient::batchAddFeishuUsersAsync(const BatchAddFeishuUsersRequest& request, const BatchAddFeishuUsersAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, batchAddFeishuUsers(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +Quickbi_publicClient::BatchAddFeishuUsersOutcomeCallable Quickbi_publicClient::batchAddFeishuUsersCallable(const BatchAddFeishuUsersRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->batchAddFeishuUsers(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + Quickbi_publicClient::CancelAuthorizationMenuOutcome Quickbi_publicClient::cancelAuthorizationMenu(const CancelAuthorizationMenuRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); diff --git a/quickbi-public/src/model/BatchAddFeishuUsersRequest.cc b/quickbi-public/src/model/BatchAddFeishuUsersRequest.cc new file mode 100644 index 000000000..9c995f8a5 --- /dev/null +++ b/quickbi-public/src/model/BatchAddFeishuUsersRequest.cc @@ -0,0 +1,90 @@ +/* + * 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::Quickbi_public::Model::BatchAddFeishuUsersRequest; + +BatchAddFeishuUsersRequest::BatchAddFeishuUsersRequest() + : RpcServiceRequest("quickbi-public", "2022-01-01", "BatchAddFeishuUsers") { + setMethod(HttpRequest::Method::Post); +} + +BatchAddFeishuUsersRequest::~BatchAddFeishuUsersRequest() {} + +bool BatchAddFeishuUsersRequest::getIsAdmin() const { + return isAdmin_; +} + +void BatchAddFeishuUsersRequest::setIsAdmin(bool isAdmin) { + isAdmin_ = isAdmin; + setParameter(std::string("IsAdmin"), isAdmin ? "true" : "false"); +} + +std::string BatchAddFeishuUsersRequest::getFeishuUsers() const { + return feishuUsers_; +} + +void BatchAddFeishuUsersRequest::setFeishuUsers(const std::string &feishuUsers) { + feishuUsers_ = feishuUsers; + setParameter(std::string("FeishuUsers"), feishuUsers); +} + +std::string BatchAddFeishuUsersRequest::getAccessPoint() const { + return accessPoint_; +} + +void BatchAddFeishuUsersRequest::setAccessPoint(const std::string &accessPoint) { + accessPoint_ = accessPoint; + setParameter(std::string("AccessPoint"), accessPoint); +} + +int BatchAddFeishuUsersRequest::getUserType() const { + return userType_; +} + +void BatchAddFeishuUsersRequest::setUserType(int userType) { + userType_ = userType; + setParameter(std::string("UserType"), std::to_string(userType)); +} + +std::string BatchAddFeishuUsersRequest::getSignType() const { + return signType_; +} + +void BatchAddFeishuUsersRequest::setSignType(const std::string &signType) { + signType_ = signType; + setParameter(std::string("SignType"), signType); +} + +std::string BatchAddFeishuUsersRequest::getUserGroupIds() const { + return userGroupIds_; +} + +void BatchAddFeishuUsersRequest::setUserGroupIds(const std::string &userGroupIds) { + userGroupIds_ = userGroupIds; + setParameter(std::string("UserGroupIds"), userGroupIds); +} + +bool BatchAddFeishuUsersRequest::getIsAuthAdmin() const { + return isAuthAdmin_; +} + +void BatchAddFeishuUsersRequest::setIsAuthAdmin(bool isAuthAdmin) { + isAuthAdmin_ = isAuthAdmin; + setParameter(std::string("IsAuthAdmin"), isAuthAdmin ? "true" : "false"); +} + diff --git a/quickbi-public/src/model/BatchAddFeishuUsersResult.cc b/quickbi-public/src/model/BatchAddFeishuUsersResult.cc new file mode 100644 index 000000000..e79e4f8e9 --- /dev/null +++ b/quickbi-public/src/model/BatchAddFeishuUsersResult.cc @@ -0,0 +1,79 @@ +/* + * 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::Quickbi_public; +using namespace AlibabaCloud::Quickbi_public::Model; + +BatchAddFeishuUsersResult::BatchAddFeishuUsersResult() : + ServiceResult() +{} + +BatchAddFeishuUsersResult::BatchAddFeishuUsersResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +BatchAddFeishuUsersResult::~BatchAddFeishuUsersResult() +{} + +void BatchAddFeishuUsersResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto resultNode = value["Result"]; + if(!resultNode["OkCount"].isNull()) + result_.okCount = std::stoi(resultNode["OkCount"].asString()); + if(!resultNode["FailCount"].isNull()) + result_.failCount = std::stoi(resultNode["FailCount"].asString()); + auto allFailResultsNode = resultNode["FailResults"]["FailResultsItem"]; + for (auto resultNodeFailResultsFailResultsItem : allFailResultsNode) + { + Result::FailResultsItem failResultsItemObject; + auto allFailInfosNode = resultNodeFailResultsFailResultsItem["FailInfos"]["FailInfosItem"]; + for (auto resultNodeFailResultsFailResultsItemFailInfosFailInfosItem : allFailInfosNode) + { + Result::FailResultsItem::FailInfosItem failInfosObject; + if(!resultNodeFailResultsFailResultsItemFailInfosFailInfosItem["Code"].isNull()) + failInfosObject.code = resultNodeFailResultsFailResultsItemFailInfosFailInfosItem["Code"].asString(); + if(!resultNodeFailResultsFailResultsItemFailInfosFailInfosItem["Input"].isNull()) + failInfosObject.input = resultNodeFailResultsFailResultsItemFailInfosFailInfosItem["Input"].asString(); + if(!resultNodeFailResultsFailResultsItemFailInfosFailInfosItem["CodeDesc"].isNull()) + failInfosObject.codeDesc = resultNodeFailResultsFailResultsItemFailInfosFailInfosItem["CodeDesc"].asString(); + failResultsItemObject.failInfos.push_back(failInfosObject); + } + result_.failResults.push_back(failResultsItemObject); + } + if(!value["Success"].isNull()) + success_ = value["Success"].asString() == "true"; + +} + +bool BatchAddFeishuUsersResult::getSuccess()const +{ + return success_; +} + +BatchAddFeishuUsersResult::Result BatchAddFeishuUsersResult::getResult()const +{ + return result_; +} +