Supported GetProxyAccess API.
This commit is contained in:
@@ -169,6 +169,8 @@ set(dms-enterprise_public_header_model
|
||||
include/alibabacloud/dms-enterprise/model/GetPhysicalDatabaseResult.h
|
||||
include/alibabacloud/dms-enterprise/model/GetProxyRequest.h
|
||||
include/alibabacloud/dms-enterprise/model/GetProxyResult.h
|
||||
include/alibabacloud/dms-enterprise/model/GetProxyAccessRequest.h
|
||||
include/alibabacloud/dms-enterprise/model/GetProxyAccessResult.h
|
||||
include/alibabacloud/dms-enterprise/model/GetRuleNumLimitOfSLARequest.h
|
||||
include/alibabacloud/dms-enterprise/model/GetRuleNumLimitOfSLAResult.h
|
||||
include/alibabacloud/dms-enterprise/model/GetSQLReviewCheckResultStatusRequest.h
|
||||
@@ -536,6 +538,8 @@ set(dms-enterprise_src
|
||||
src/model/GetPhysicalDatabaseResult.cc
|
||||
src/model/GetProxyRequest.cc
|
||||
src/model/GetProxyResult.cc
|
||||
src/model/GetProxyAccessRequest.cc
|
||||
src/model/GetProxyAccessResult.cc
|
||||
src/model/GetRuleNumLimitOfSLARequest.cc
|
||||
src/model/GetRuleNumLimitOfSLAResult.cc
|
||||
src/model/GetSQLReviewCheckResultStatusRequest.cc
|
||||
|
||||
@@ -170,6 +170,8 @@
|
||||
#include "model/GetPhysicalDatabaseResult.h"
|
||||
#include "model/GetProxyRequest.h"
|
||||
#include "model/GetProxyResult.h"
|
||||
#include "model/GetProxyAccessRequest.h"
|
||||
#include "model/GetProxyAccessResult.h"
|
||||
#include "model/GetRuleNumLimitOfSLARequest.h"
|
||||
#include "model/GetRuleNumLimitOfSLAResult.h"
|
||||
#include "model/GetSQLReviewCheckResultStatusRequest.h"
|
||||
@@ -617,6 +619,9 @@ namespace AlibabaCloud
|
||||
typedef Outcome<Error, Model::GetProxyResult> GetProxyOutcome;
|
||||
typedef std::future<GetProxyOutcome> GetProxyOutcomeCallable;
|
||||
typedef std::function<void(const Dms_enterpriseClient*, const Model::GetProxyRequest&, const GetProxyOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetProxyAsyncHandler;
|
||||
typedef Outcome<Error, Model::GetProxyAccessResult> GetProxyAccessOutcome;
|
||||
typedef std::future<GetProxyAccessOutcome> GetProxyAccessOutcomeCallable;
|
||||
typedef std::function<void(const Dms_enterpriseClient*, const Model::GetProxyAccessRequest&, const GetProxyAccessOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetProxyAccessAsyncHandler;
|
||||
typedef Outcome<Error, Model::GetRuleNumLimitOfSLAResult> GetRuleNumLimitOfSLAOutcome;
|
||||
typedef std::future<GetRuleNumLimitOfSLAOutcome> GetRuleNumLimitOfSLAOutcomeCallable;
|
||||
typedef std::function<void(const Dms_enterpriseClient*, const Model::GetRuleNumLimitOfSLARequest&, const GetRuleNumLimitOfSLAOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetRuleNumLimitOfSLAAsyncHandler;
|
||||
@@ -1168,6 +1173,9 @@ namespace AlibabaCloud
|
||||
GetProxyOutcome getProxy(const Model::GetProxyRequest &request)const;
|
||||
void getProxyAsync(const Model::GetProxyRequest& request, const GetProxyAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
GetProxyOutcomeCallable getProxyCallable(const Model::GetProxyRequest& request) const;
|
||||
GetProxyAccessOutcome getProxyAccess(const Model::GetProxyAccessRequest &request)const;
|
||||
void getProxyAccessAsync(const Model::GetProxyAccessRequest& request, const GetProxyAccessAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
GetProxyAccessOutcomeCallable getProxyAccessCallable(const Model::GetProxyAccessRequest& request) const;
|
||||
GetRuleNumLimitOfSLAOutcome getRuleNumLimitOfSLA(const Model::GetRuleNumLimitOfSLARequest &request)const;
|
||||
void getRuleNumLimitOfSLAAsync(const Model::GetRuleNumLimitOfSLARequest& request, const GetRuleNumLimitOfSLAAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
GetRuleNumLimitOfSLAOutcomeCallable getRuleNumLimitOfSLACallable(const Model::GetRuleNumLimitOfSLARequest& request) const;
|
||||
|
||||
@@ -37,6 +37,7 @@ namespace AlibabaCloud
|
||||
AddTaskFlowEdgesResult();
|
||||
explicit AddTaskFlowEdgesResult(const std::string &payload);
|
||||
~AddTaskFlowEdgesResult();
|
||||
std::vector<std::string> getEdgeIds()const;
|
||||
std::string getErrorCode()const;
|
||||
std::string getErrorMessage()const;
|
||||
bool getSuccess()const;
|
||||
@@ -44,6 +45,7 @@ namespace AlibabaCloud
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::vector<std::string> edgeIds_;
|
||||
std::string errorCode_;
|
||||
std::string errorMessage_;
|
||||
bool success_;
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* 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_DMS_ENTERPRISE_MODEL_GETPROXYACCESSREQUEST_H_
|
||||
#define ALIBABACLOUD_DMS_ENTERPRISE_MODEL_GETPROXYACCESSREQUEST_H_
|
||||
|
||||
#include <alibabacloud/dms-enterprise/Dms_enterpriseExport.h>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
namespace AlibabaCloud {
|
||||
namespace Dms_enterprise {
|
||||
namespace Model {
|
||||
class ALIBABACLOUD_DMS_ENTERPRISE_EXPORT GetProxyAccessRequest : public RpcServiceRequest {
|
||||
public:
|
||||
GetProxyAccessRequest();
|
||||
~GetProxyAccessRequest();
|
||||
long getProxyAccessId() const;
|
||||
void setProxyAccessId(long proxyAccessId);
|
||||
long getTid() const;
|
||||
void setTid(long tid);
|
||||
|
||||
private:
|
||||
long proxyAccessId_;
|
||||
long tid_;
|
||||
};
|
||||
} // namespace Model
|
||||
} // namespace Dms_enterprise
|
||||
} // namespace AlibabaCloud
|
||||
#endif // !ALIBABACLOUD_DMS_ENTERPRISE_MODEL_GETPROXYACCESSREQUEST_H_
|
||||
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* 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_DMS_ENTERPRISE_MODEL_GETPROXYACCESSRESULT_H_
|
||||
#define ALIBABACLOUD_DMS_ENTERPRISE_MODEL_GETPROXYACCESSRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/dms-enterprise/Dms_enterpriseExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Dms_enterprise
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_DMS_ENTERPRISE_EXPORT GetProxyAccessResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct ProxyAccess
|
||||
{
|
||||
std::string gmtCreate;
|
||||
std::string userName;
|
||||
std::string accessId;
|
||||
long instanceId;
|
||||
long userId;
|
||||
std::string userUid;
|
||||
long proxyId;
|
||||
long proxyAccessId;
|
||||
std::string originInfo;
|
||||
std::string indepAccount;
|
||||
};
|
||||
|
||||
|
||||
GetProxyAccessResult();
|
||||
explicit GetProxyAccessResult(const std::string &payload);
|
||||
~GetProxyAccessResult();
|
||||
ProxyAccess getProxyAccess()const;
|
||||
std::string getErrorCode()const;
|
||||
std::string getErrorMessage()const;
|
||||
bool getSuccess()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
ProxyAccess proxyAccess_;
|
||||
std::string errorCode_;
|
||||
std::string errorMessage_;
|
||||
bool success_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_DMS_ENTERPRISE_MODEL_GETPROXYACCESSRESULT_H_
|
||||
@@ -36,6 +36,7 @@ namespace AlibabaCloud
|
||||
{
|
||||
std::string loginName;
|
||||
std::string email;
|
||||
std::string userId;
|
||||
std::string realName;
|
||||
std::string nickName;
|
||||
};
|
||||
|
||||
@@ -2715,6 +2715,42 @@ Dms_enterpriseClient::GetProxyOutcomeCallable Dms_enterpriseClient::getProxyCall
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
Dms_enterpriseClient::GetProxyAccessOutcome Dms_enterpriseClient::getProxyAccess(const GetProxyAccessRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return GetProxyAccessOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return GetProxyAccessOutcome(GetProxyAccessResult(outcome.result()));
|
||||
else
|
||||
return GetProxyAccessOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void Dms_enterpriseClient::getProxyAccessAsync(const GetProxyAccessRequest& request, const GetProxyAccessAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, getProxyAccess(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
Dms_enterpriseClient::GetProxyAccessOutcomeCallable Dms_enterpriseClient::getProxyAccessCallable(const GetProxyAccessRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<GetProxyAccessOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->getProxyAccess(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
Dms_enterpriseClient::GetRuleNumLimitOfSLAOutcome Dms_enterpriseClient::getRuleNumLimitOfSLA(const GetRuleNumLimitOfSLARequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
|
||||
@@ -39,6 +39,9 @@ void AddTaskFlowEdgesResult::parse(const std::string &payload)
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto allEdgeIds = value["EdgeIds"]["EdgeId"];
|
||||
for (const auto &item : allEdgeIds)
|
||||
edgeIds_.push_back(item.asString());
|
||||
if(!value["ErrorCode"].isNull())
|
||||
errorCode_ = value["ErrorCode"].asString();
|
||||
if(!value["ErrorMessage"].isNull())
|
||||
@@ -48,6 +51,11 @@ void AddTaskFlowEdgesResult::parse(const std::string &payload)
|
||||
|
||||
}
|
||||
|
||||
std::vector<std::string> AddTaskFlowEdgesResult::getEdgeIds()const
|
||||
{
|
||||
return edgeIds_;
|
||||
}
|
||||
|
||||
std::string AddTaskFlowEdgesResult::getErrorCode()const
|
||||
{
|
||||
return errorCode_;
|
||||
|
||||
45
dms-enterprise/src/model/GetProxyAccessRequest.cc
Normal file
45
dms-enterprise/src/model/GetProxyAccessRequest.cc
Normal file
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* 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/dms-enterprise/model/GetProxyAccessRequest.h>
|
||||
|
||||
using AlibabaCloud::Dms_enterprise::Model::GetProxyAccessRequest;
|
||||
|
||||
GetProxyAccessRequest::GetProxyAccessRequest()
|
||||
: RpcServiceRequest("dms-enterprise", "2018-11-01", "GetProxyAccess") {
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
GetProxyAccessRequest::~GetProxyAccessRequest() {}
|
||||
|
||||
long GetProxyAccessRequest::getProxyAccessId() const {
|
||||
return proxyAccessId_;
|
||||
}
|
||||
|
||||
void GetProxyAccessRequest::setProxyAccessId(long proxyAccessId) {
|
||||
proxyAccessId_ = proxyAccessId;
|
||||
setParameter(std::string("ProxyAccessId"), std::to_string(proxyAccessId));
|
||||
}
|
||||
|
||||
long GetProxyAccessRequest::getTid() const {
|
||||
return tid_;
|
||||
}
|
||||
|
||||
void GetProxyAccessRequest::setTid(long tid) {
|
||||
tid_ = tid;
|
||||
setParameter(std::string("Tid"), std::to_string(tid));
|
||||
}
|
||||
|
||||
91
dms-enterprise/src/model/GetProxyAccessResult.cc
Normal file
91
dms-enterprise/src/model/GetProxyAccessResult.cc
Normal file
@@ -0,0 +1,91 @@
|
||||
/*
|
||||
* 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/dms-enterprise/model/GetProxyAccessResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Dms_enterprise;
|
||||
using namespace AlibabaCloud::Dms_enterprise::Model;
|
||||
|
||||
GetProxyAccessResult::GetProxyAccessResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
GetProxyAccessResult::GetProxyAccessResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
GetProxyAccessResult::~GetProxyAccessResult()
|
||||
{}
|
||||
|
||||
void GetProxyAccessResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto proxyAccessNode = value["ProxyAccess"];
|
||||
if(!proxyAccessNode["ProxyAccessId"].isNull())
|
||||
proxyAccess_.proxyAccessId = std::stol(proxyAccessNode["ProxyAccessId"].asString());
|
||||
if(!proxyAccessNode["GmtCreate"].isNull())
|
||||
proxyAccess_.gmtCreate = proxyAccessNode["GmtCreate"].asString();
|
||||
if(!proxyAccessNode["AccessId"].isNull())
|
||||
proxyAccess_.accessId = proxyAccessNode["AccessId"].asString();
|
||||
if(!proxyAccessNode["OriginInfo"].isNull())
|
||||
proxyAccess_.originInfo = proxyAccessNode["OriginInfo"].asString();
|
||||
if(!proxyAccessNode["IndepAccount"].isNull())
|
||||
proxyAccess_.indepAccount = proxyAccessNode["IndepAccount"].asString();
|
||||
if(!proxyAccessNode["UserId"].isNull())
|
||||
proxyAccess_.userId = std::stol(proxyAccessNode["UserId"].asString());
|
||||
if(!proxyAccessNode["UserUid"].isNull())
|
||||
proxyAccess_.userUid = proxyAccessNode["UserUid"].asString();
|
||||
if(!proxyAccessNode["UserName"].isNull())
|
||||
proxyAccess_.userName = proxyAccessNode["UserName"].asString();
|
||||
if(!proxyAccessNode["ProxyId"].isNull())
|
||||
proxyAccess_.proxyId = std::stol(proxyAccessNode["ProxyId"].asString());
|
||||
if(!proxyAccessNode["InstanceId"].isNull())
|
||||
proxyAccess_.instanceId = std::stol(proxyAccessNode["InstanceId"].asString());
|
||||
if(!value["Success"].isNull())
|
||||
success_ = value["Success"].asString() == "true";
|
||||
if(!value["ErrorMessage"].isNull())
|
||||
errorMessage_ = value["ErrorMessage"].asString();
|
||||
if(!value["ErrorCode"].isNull())
|
||||
errorCode_ = value["ErrorCode"].asString();
|
||||
|
||||
}
|
||||
|
||||
GetProxyAccessResult::ProxyAccess GetProxyAccessResult::getProxyAccess()const
|
||||
{
|
||||
return proxyAccess_;
|
||||
}
|
||||
|
||||
std::string GetProxyAccessResult::getErrorCode()const
|
||||
{
|
||||
return errorCode_;
|
||||
}
|
||||
|
||||
std::string GetProxyAccessResult::getErrorMessage()const
|
||||
{
|
||||
return errorMessage_;
|
||||
}
|
||||
|
||||
bool GetProxyAccessResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
@@ -51,6 +51,8 @@ void ListTaskFlowCooperatorsResult::parse(const std::string &payload)
|
||||
cooperatorListObject.loginName = valueCooperatorListCooperator["LoginName"].asString();
|
||||
if(!valueCooperatorListCooperator["RealName"].isNull())
|
||||
cooperatorListObject.realName = valueCooperatorListCooperator["RealName"].asString();
|
||||
if(!valueCooperatorListCooperator["UserId"].isNull())
|
||||
cooperatorListObject.userId = valueCooperatorListCooperator["UserId"].asString();
|
||||
cooperatorList_.push_back(cooperatorListObject);
|
||||
}
|
||||
if(!value["ErrorCode"].isNull())
|
||||
|
||||
Reference in New Issue
Block a user