Add API BatchAddFeishuUsers.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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<Error, Model::AuthorizeMenuResult> AuthorizeMenuOutcome;
|
||||
typedef std::future<AuthorizeMenuOutcome> AuthorizeMenuOutcomeCallable;
|
||||
typedef std::function<void(const Quickbi_publicClient*, const Model::AuthorizeMenuRequest&, const AuthorizeMenuOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> AuthorizeMenuAsyncHandler;
|
||||
typedef Outcome<Error, Model::BatchAddFeishuUsersResult> BatchAddFeishuUsersOutcome;
|
||||
typedef std::future<BatchAddFeishuUsersOutcome> BatchAddFeishuUsersOutcomeCallable;
|
||||
typedef std::function<void(const Quickbi_publicClient*, const Model::BatchAddFeishuUsersRequest&, const BatchAddFeishuUsersOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> BatchAddFeishuUsersAsyncHandler;
|
||||
typedef Outcome<Error, Model::CancelAuthorizationMenuResult> CancelAuthorizationMenuOutcome;
|
||||
typedef std::future<CancelAuthorizationMenuOutcome> CancelAuthorizationMenuOutcomeCallable;
|
||||
typedef std::function<void(const Quickbi_publicClient*, const Model::CancelAuthorizationMenuRequest&, const CancelAuthorizationMenuOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> 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<const AsyncCallerContext>& 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<const AsyncCallerContext>& 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<const AsyncCallerContext>& context = nullptr) const;
|
||||
CancelAuthorizationMenuOutcomeCallable cancelAuthorizationMenuCallable(const Model::CancelAuthorizationMenuRequest& request) const;
|
||||
|
||||
@@ -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 <alibabacloud/quickbi-public/Quickbi_publicExport.h>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
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_
|
||||
@@ -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 <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/quickbi-public/Quickbi_publicExport.h>
|
||||
|
||||
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<FailResultsItem::FailInfosItem> failInfos;
|
||||
};
|
||||
int okCount;
|
||||
int failCount;
|
||||
std::vector<FailResultsItem> 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_
|
||||
@@ -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<const AsyncCallerContext>& 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<std::packaged_task<BatchAddFeishuUsersOutcome()>>(
|
||||
[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();
|
||||
|
||||
90
quickbi-public/src/model/BatchAddFeishuUsersRequest.cc
Normal file
90
quickbi-public/src/model/BatchAddFeishuUsersRequest.cc
Normal file
@@ -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 <alibabacloud/quickbi-public/model/BatchAddFeishuUsersRequest.h>
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
79
quickbi-public/src/model/BatchAddFeishuUsersResult.cc
Normal file
79
quickbi-public/src/model/BatchAddFeishuUsersResult.cc
Normal file
@@ -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 <alibabacloud/quickbi-public/model/BatchAddFeishuUsersResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
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_;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user