Support new feature.

This commit is contained in:
sdk-team
2023-07-26 07:47:33 +00:00
parent 9c0b9836df
commit 5ba3ade3e4
12 changed files with 520 additions and 1 deletions

View File

@@ -195,6 +195,42 @@ PolardbClient::CheckKMSAuthorizedOutcomeCallable PolardbClient::checkKMSAuthoriz
return task->get_future();
}
PolardbClient::CheckServiceLinkedRoleOutcome PolardbClient::checkServiceLinkedRole(const CheckServiceLinkedRoleRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return CheckServiceLinkedRoleOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return CheckServiceLinkedRoleOutcome(CheckServiceLinkedRoleResult(outcome.result()));
else
return CheckServiceLinkedRoleOutcome(outcome.error());
}
void PolardbClient::checkServiceLinkedRoleAsync(const CheckServiceLinkedRoleRequest& request, const CheckServiceLinkedRoleAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, checkServiceLinkedRole(request), context);
};
asyncExecute(new Runnable(fn));
}
PolardbClient::CheckServiceLinkedRoleOutcomeCallable PolardbClient::checkServiceLinkedRoleCallable(const CheckServiceLinkedRoleRequest &request) const
{
auto task = std::make_shared<std::packaged_task<CheckServiceLinkedRoleOutcome()>>(
[this, request]()
{
return this->checkServiceLinkedRole(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
PolardbClient::CloseAITaskOutcome PolardbClient::closeAITask(const CloseAITaskRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -663,6 +699,42 @@ PolardbClient::CreateParameterGroupOutcomeCallable PolardbClient::createParamete
return task->get_future();
}
PolardbClient::CreateServiceLinkedRoleOutcome PolardbClient::createServiceLinkedRole(const CreateServiceLinkedRoleRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return CreateServiceLinkedRoleOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return CreateServiceLinkedRoleOutcome(CreateServiceLinkedRoleResult(outcome.result()));
else
return CreateServiceLinkedRoleOutcome(outcome.error());
}
void PolardbClient::createServiceLinkedRoleAsync(const CreateServiceLinkedRoleRequest& request, const CreateServiceLinkedRoleAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, createServiceLinkedRole(request), context);
};
asyncExecute(new Runnable(fn));
}
PolardbClient::CreateServiceLinkedRoleOutcomeCallable PolardbClient::createServiceLinkedRoleCallable(const CreateServiceLinkedRoleRequest &request) const
{
auto task = std::make_shared<std::packaged_task<CreateServiceLinkedRoleOutcome()>>(
[this, request]()
{
return this->createServiceLinkedRole(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
PolardbClient::CreateStoragePlanOutcome PolardbClient::createStoragePlan(const CreateStoragePlanRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();

View File

@@ -0,0 +1,63 @@
/*
* 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/polardb/model/CheckServiceLinkedRoleRequest.h>
using AlibabaCloud::Polardb::Model::CheckServiceLinkedRoleRequest;
CheckServiceLinkedRoleRequest::CheckServiceLinkedRoleRequest()
: RpcServiceRequest("polardb", "2017-08-01", "CheckServiceLinkedRole") {
setMethod(HttpRequest::Method::Post);
}
CheckServiceLinkedRoleRequest::~CheckServiceLinkedRoleRequest() {}
long CheckServiceLinkedRoleRequest::getResourceOwnerId() const {
return resourceOwnerId_;
}
void CheckServiceLinkedRoleRequest::setResourceOwnerId(long resourceOwnerId) {
resourceOwnerId_ = resourceOwnerId;
setParameter(std::string("ResourceOwnerId"), std::to_string(resourceOwnerId));
}
std::string CheckServiceLinkedRoleRequest::getResourceOwnerAccount() const {
return resourceOwnerAccount_;
}
void CheckServiceLinkedRoleRequest::setResourceOwnerAccount(const std::string &resourceOwnerAccount) {
resourceOwnerAccount_ = resourceOwnerAccount;
setParameter(std::string("ResourceOwnerAccount"), resourceOwnerAccount);
}
std::string CheckServiceLinkedRoleRequest::getOwnerAccount() const {
return ownerAccount_;
}
void CheckServiceLinkedRoleRequest::setOwnerAccount(const std::string &ownerAccount) {
ownerAccount_ = ownerAccount;
setParameter(std::string("OwnerAccount"), ownerAccount);
}
long CheckServiceLinkedRoleRequest::getOwnerId() const {
return ownerId_;
}
void CheckServiceLinkedRoleRequest::setOwnerId(long ownerId) {
ownerId_ = ownerId;
setParameter(std::string("OwnerId"), std::to_string(ownerId));
}

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/polardb/model/CheckServiceLinkedRoleResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Polardb;
using namespace AlibabaCloud::Polardb::Model;
CheckServiceLinkedRoleResult::CheckServiceLinkedRoleResult() :
ServiceResult()
{}
CheckServiceLinkedRoleResult::CheckServiceLinkedRoleResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
CheckServiceLinkedRoleResult::~CheckServiceLinkedRoleResult()
{}
void CheckServiceLinkedRoleResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
if(!value["HasServiceLinkedRole"].isNull())
hasServiceLinkedRole_ = value["HasServiceLinkedRole"].asString() == "true";
}
bool CheckServiceLinkedRoleResult::getHasServiceLinkedRole()const
{
return hasServiceLinkedRole_;
}

View File

@@ -0,0 +1,63 @@
/*
* 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/polardb/model/CreateServiceLinkedRoleRequest.h>
using AlibabaCloud::Polardb::Model::CreateServiceLinkedRoleRequest;
CreateServiceLinkedRoleRequest::CreateServiceLinkedRoleRequest()
: RpcServiceRequest("polardb", "2017-08-01", "CreateServiceLinkedRole") {
setMethod(HttpRequest::Method::Post);
}
CreateServiceLinkedRoleRequest::~CreateServiceLinkedRoleRequest() {}
long CreateServiceLinkedRoleRequest::getResourceOwnerId() const {
return resourceOwnerId_;
}
void CreateServiceLinkedRoleRequest::setResourceOwnerId(long resourceOwnerId) {
resourceOwnerId_ = resourceOwnerId;
setParameter(std::string("ResourceOwnerId"), std::to_string(resourceOwnerId));
}
std::string CreateServiceLinkedRoleRequest::getResourceOwnerAccount() const {
return resourceOwnerAccount_;
}
void CreateServiceLinkedRoleRequest::setResourceOwnerAccount(const std::string &resourceOwnerAccount) {
resourceOwnerAccount_ = resourceOwnerAccount;
setParameter(std::string("ResourceOwnerAccount"), resourceOwnerAccount);
}
std::string CreateServiceLinkedRoleRequest::getOwnerAccount() const {
return ownerAccount_;
}
void CreateServiceLinkedRoleRequest::setOwnerAccount(const std::string &ownerAccount) {
ownerAccount_ = ownerAccount;
setParameter(std::string("OwnerAccount"), ownerAccount);
}
long CreateServiceLinkedRoleRequest::getOwnerId() const {
return ownerId_;
}
void CreateServiceLinkedRoleRequest::setOwnerId(long ownerId) {
ownerId_ = ownerId;
setParameter(std::string("OwnerId"), std::to_string(ownerId));
}

View File

@@ -0,0 +1,44 @@
/*
* 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/polardb/model/CreateServiceLinkedRoleResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Polardb;
using namespace AlibabaCloud::Polardb::Model;
CreateServiceLinkedRoleResult::CreateServiceLinkedRoleResult() :
ServiceResult()
{}
CreateServiceLinkedRoleResult::CreateServiceLinkedRoleResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
CreateServiceLinkedRoleResult::~CreateServiceLinkedRoleResult()
{}
void CreateServiceLinkedRoleResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
}