Automatically generate sdk tasks.

This commit is contained in:
sdk-team
2023-08-03 15:00:31 +00:00
parent 4b160fe6b9
commit c994b2d439
45 changed files with 3375 additions and 1 deletions

View File

@@ -0,0 +1,413 @@
/*
* 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/rds-data/Rds_dataClient.h>
#include <alibabacloud/core/SimpleCredentialsProvider.h>
using namespace AlibabaCloud;
using namespace AlibabaCloud::Location;
using namespace AlibabaCloud::Rds_data;
using namespace AlibabaCloud::Rds_data::Model;
namespace
{
const std::string SERVICE_NAME = "rds-data";
}
Rds_dataClient::Rds_dataClient(const Credentials &credentials, const ClientConfiguration &configuration) :
RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(credentials), configuration)
{
auto locationClient = std::make_shared<LocationClient>(credentials, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
}
Rds_dataClient::Rds_dataClient(const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) :
RpcServiceClient(SERVICE_NAME, credentialsProvider, configuration)
{
auto locationClient = std::make_shared<LocationClient>(credentialsProvider, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
}
Rds_dataClient::Rds_dataClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) :
RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(accessKeyId, accessKeySecret), configuration)
{
auto locationClient = std::make_shared<LocationClient>(accessKeyId, accessKeySecret, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
}
Rds_dataClient::~Rds_dataClient()
{}
Rds_dataClient::BatchExecuteStatementOutcome Rds_dataClient::batchExecuteStatement(const BatchExecuteStatementRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return BatchExecuteStatementOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return BatchExecuteStatementOutcome(BatchExecuteStatementResult(outcome.result()));
else
return BatchExecuteStatementOutcome(outcome.error());
}
void Rds_dataClient::batchExecuteStatementAsync(const BatchExecuteStatementRequest& request, const BatchExecuteStatementAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, batchExecuteStatement(request), context);
};
asyncExecute(new Runnable(fn));
}
Rds_dataClient::BatchExecuteStatementOutcomeCallable Rds_dataClient::batchExecuteStatementCallable(const BatchExecuteStatementRequest &request) const
{
auto task = std::make_shared<std::packaged_task<BatchExecuteStatementOutcome()>>(
[this, request]()
{
return this->batchExecuteStatement(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
Rds_dataClient::BeginTransactionOutcome Rds_dataClient::beginTransaction(const BeginTransactionRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return BeginTransactionOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return BeginTransactionOutcome(BeginTransactionResult(outcome.result()));
else
return BeginTransactionOutcome(outcome.error());
}
void Rds_dataClient::beginTransactionAsync(const BeginTransactionRequest& request, const BeginTransactionAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, beginTransaction(request), context);
};
asyncExecute(new Runnable(fn));
}
Rds_dataClient::BeginTransactionOutcomeCallable Rds_dataClient::beginTransactionCallable(const BeginTransactionRequest &request) const
{
auto task = std::make_shared<std::packaged_task<BeginTransactionOutcome()>>(
[this, request]()
{
return this->beginTransaction(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
Rds_dataClient::CommitTransactionOutcome Rds_dataClient::commitTransaction(const CommitTransactionRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return CommitTransactionOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return CommitTransactionOutcome(CommitTransactionResult(outcome.result()));
else
return CommitTransactionOutcome(outcome.error());
}
void Rds_dataClient::commitTransactionAsync(const CommitTransactionRequest& request, const CommitTransactionAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, commitTransaction(request), context);
};
asyncExecute(new Runnable(fn));
}
Rds_dataClient::CommitTransactionOutcomeCallable Rds_dataClient::commitTransactionCallable(const CommitTransactionRequest &request) const
{
auto task = std::make_shared<std::packaged_task<CommitTransactionOutcome()>>(
[this, request]()
{
return this->commitTransaction(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
Rds_dataClient::DeleteOutcome Rds_dataClient::delete(const DeleteRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return DeleteOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return DeleteOutcome(DeleteResult(outcome.result()));
else
return DeleteOutcome(outcome.error());
}
void Rds_dataClient::deleteAsync(const DeleteRequest& request, const DeleteAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, delete(request), context);
};
asyncExecute(new Runnable(fn));
}
Rds_dataClient::DeleteOutcomeCallable Rds_dataClient::deleteCallable(const DeleteRequest &request) const
{
auto task = std::make_shared<std::packaged_task<DeleteOutcome()>>(
[this, request]()
{
return this->delete(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
Rds_dataClient::ExecuteStatementOutcome Rds_dataClient::executeStatement(const ExecuteStatementRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return ExecuteStatementOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return ExecuteStatementOutcome(ExecuteStatementResult(outcome.result()));
else
return ExecuteStatementOutcome(outcome.error());
}
void Rds_dataClient::executeStatementAsync(const ExecuteStatementRequest& request, const ExecuteStatementAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, executeStatement(request), context);
};
asyncExecute(new Runnable(fn));
}
Rds_dataClient::ExecuteStatementOutcomeCallable Rds_dataClient::executeStatementCallable(const ExecuteStatementRequest &request) const
{
auto task = std::make_shared<std::packaged_task<ExecuteStatementOutcome()>>(
[this, request]()
{
return this->executeStatement(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
Rds_dataClient::InsertOutcome Rds_dataClient::insert(const InsertRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return InsertOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return InsertOutcome(InsertResult(outcome.result()));
else
return InsertOutcome(outcome.error());
}
void Rds_dataClient::insertAsync(const InsertRequest& request, const InsertAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, insert(request), context);
};
asyncExecute(new Runnable(fn));
}
Rds_dataClient::InsertOutcomeCallable Rds_dataClient::insertCallable(const InsertRequest &request) const
{
auto task = std::make_shared<std::packaged_task<InsertOutcome()>>(
[this, request]()
{
return this->insert(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
Rds_dataClient::InsertListOutcome Rds_dataClient::insertList(const InsertListRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return InsertListOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return InsertListOutcome(InsertListResult(outcome.result()));
else
return InsertListOutcome(outcome.error());
}
void Rds_dataClient::insertListAsync(const InsertListRequest& request, const InsertListAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, insertList(request), context);
};
asyncExecute(new Runnable(fn));
}
Rds_dataClient::InsertListOutcomeCallable Rds_dataClient::insertListCallable(const InsertListRequest &request) const
{
auto task = std::make_shared<std::packaged_task<InsertListOutcome()>>(
[this, request]()
{
return this->insertList(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
Rds_dataClient::RollbackTransactionOutcome Rds_dataClient::rollbackTransaction(const RollbackTransactionRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return RollbackTransactionOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return RollbackTransactionOutcome(RollbackTransactionResult(outcome.result()));
else
return RollbackTransactionOutcome(outcome.error());
}
void Rds_dataClient::rollbackTransactionAsync(const RollbackTransactionRequest& request, const RollbackTransactionAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, rollbackTransaction(request), context);
};
asyncExecute(new Runnable(fn));
}
Rds_dataClient::RollbackTransactionOutcomeCallable Rds_dataClient::rollbackTransactionCallable(const RollbackTransactionRequest &request) const
{
auto task = std::make_shared<std::packaged_task<RollbackTransactionOutcome()>>(
[this, request]()
{
return this->rollbackTransaction(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
Rds_dataClient::SelectOutcome Rds_dataClient::select(const SelectRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return SelectOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return SelectOutcome(SelectResult(outcome.result()));
else
return SelectOutcome(outcome.error());
}
void Rds_dataClient::selectAsync(const SelectRequest& request, const SelectAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, select(request), context);
};
asyncExecute(new Runnable(fn));
}
Rds_dataClient::SelectOutcomeCallable Rds_dataClient::selectCallable(const SelectRequest &request) const
{
auto task = std::make_shared<std::packaged_task<SelectOutcome()>>(
[this, request]()
{
return this->select(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
Rds_dataClient::UpdateOutcome Rds_dataClient::update(const UpdateRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return UpdateOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return UpdateOutcome(UpdateResult(outcome.result()));
else
return UpdateOutcome(outcome.error());
}
void Rds_dataClient::updateAsync(const UpdateRequest& request, const UpdateAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, update(request), context);
};
asyncExecute(new Runnable(fn));
}
Rds_dataClient::UpdateOutcomeCallable Rds_dataClient::updateCallable(const UpdateRequest &request) const
{
auto task = std::make_shared<std::packaged_task<UpdateOutcome()>>(
[this, request]()
{
return this->update(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}

View File

@@ -0,0 +1,92 @@
/*
* 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/rds-data/model/BatchExecuteStatementRequest.h>
using AlibabaCloud::Rds_data::Model::BatchExecuteStatementRequest;
BatchExecuteStatementRequest::BatchExecuteStatementRequest()
: RpcServiceRequest("rds-data", "2022-03-30", "BatchExecuteStatement") {
setMethod(HttpRequest::Method::Post);
}
BatchExecuteStatementRequest::~BatchExecuteStatementRequest() {}
std::vector<BatchExecuteStatementRequest::std::vector<ParameterSetsItem>> BatchExecuteStatementRequest::getParameterSets() const {
return parameterSets_;
}
void BatchExecuteStatementRequest::setParameterSets(const std::vector<BatchExecuteStatementRequest::std::vector<ParameterSetsItem>> &parameterSets) {
parameterSets_ = parameterSets;
for(int dep1 = 0; dep1 != parameterSets.size(); dep1++) {
for(int dep2 = 0; dep2 != parameterSets[dep1].size(); dep2++) {
setBodyParameter(std::string("ParameterSets") + "." + std::to_string(dep1 + 1) + "." + std::to_string(dep2 + 1) + ".Name", parameterSets[dep1][dep2].name);
setBodyParameter(std::string("ParameterSets") + "." + std::to_string(dep1 + 1) + "." + std::to_string(dep2 + 1) + ".TypeHint", parameterSets[dep1][dep2].typeHint);
setBodyParameter(std::string("ParameterSets") + "." + std::to_string(dep1 + 1) + "." + std::to_string(dep2 + 1) + ".Value.ArrayValue", parameterSets[dep1][dep2].value.arrayValue);
setBodyParameter(std::string("ParameterSets") + "." + std::to_string(dep1 + 1) + "." + std::to_string(dep2 + 1) + ".Value.BlobValue", parameterSets[dep1][dep2].value.blobValue);
setBodyParameter(std::string("ParameterSets") + "." + std::to_string(dep1 + 1) + "." + std::to_string(dep2 + 1) + ".Value.BooleanValue", parameterSets[dep1][dep2].value.booleanValue ? "true" : "false");
setBodyParameter(std::string("ParameterSets") + "." + std::to_string(dep1 + 1) + "." + std::to_string(dep2 + 1) + ".Value.IsNull", parameterSets[dep1][dep2].value.isNull ? "true" : "false");
setBodyParameter(std::string("ParameterSets") + "." + std::to_string(dep1 + 1) + "." + std::to_string(dep2 + 1) + ".Value.LongValue", std::to_string(parameterSets[dep1][dep2].value.longValue));
setBodyParameter(std::string("ParameterSets") + "." + std::to_string(dep1 + 1) + "." + std::to_string(dep2 + 1) + ".Value.StringValue", parameterSets[dep1][dep2].value.stringValue);
}
}
}
std::string BatchExecuteStatementRequest::getTransactionId() const {
return transactionId_;
}
void BatchExecuteStatementRequest::setTransactionId(const std::string &transactionId) {
transactionId_ = transactionId;
setBodyParameter(std::string("TransactionId"), transactionId);
}
std::string BatchExecuteStatementRequest::getSql() const {
return sql_;
}
void BatchExecuteStatementRequest::setSql(const std::string &sql) {
sql_ = sql;
setBodyParameter(std::string("Sql"), sql);
}
std::string BatchExecuteStatementRequest::getDatabase() const {
return database_;
}
void BatchExecuteStatementRequest::setDatabase(const std::string &database) {
database_ = database;
setBodyParameter(std::string("Database"), database);
}
std::string BatchExecuteStatementRequest::getResourceArn() const {
return resourceArn_;
}
void BatchExecuteStatementRequest::setResourceArn(const std::string &resourceArn) {
resourceArn_ = resourceArn;
setBodyParameter(std::string("ResourceArn"), resourceArn);
}
std::string BatchExecuteStatementRequest::getSecretArn() const {
return secretArn_;
}
void BatchExecuteStatementRequest::setSecretArn(const std::string &secretArn) {
secretArn_ = secretArn;
setBodyParameter(std::string("SecretArn"), secretArn);
}

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/rds-data/model/BatchExecuteStatementResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Rds_data;
using namespace AlibabaCloud::Rds_data::Model;
BatchExecuteStatementResult::BatchExecuteStatementResult() :
ServiceResult()
{}
BatchExecuteStatementResult::BatchExecuteStatementResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
BatchExecuteStatementResult::~BatchExecuteStatementResult()
{}
void BatchExecuteStatementResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
}

View File

@@ -0,0 +1,54 @@
/*
* 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/rds-data/model/BeginTransactionRequest.h>
using AlibabaCloud::Rds_data::Model::BeginTransactionRequest;
BeginTransactionRequest::BeginTransactionRequest()
: RpcServiceRequest("rds-data", "2022-03-30", "BeginTransaction") {
setMethod(HttpRequest::Method::Post);
}
BeginTransactionRequest::~BeginTransactionRequest() {}
std::string BeginTransactionRequest::getDatabase() const {
return database_;
}
void BeginTransactionRequest::setDatabase(const std::string &database) {
database_ = database;
setBodyParameter(std::string("Database"), database);
}
std::string BeginTransactionRequest::getResourceArn() const {
return resourceArn_;
}
void BeginTransactionRequest::setResourceArn(const std::string &resourceArn) {
resourceArn_ = resourceArn;
setBodyParameter(std::string("ResourceArn"), resourceArn);
}
std::string BeginTransactionRequest::getSecretArn() const {
return secretArn_;
}
void BeginTransactionRequest::setSecretArn(const std::string &secretArn) {
secretArn_ = secretArn;
setBodyParameter(std::string("SecretArn"), secretArn);
}

View File

@@ -0,0 +1,73 @@
/*
* 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/rds-data/model/BeginTransactionResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Rds_data;
using namespace AlibabaCloud::Rds_data::Model;
BeginTransactionResult::BeginTransactionResult() :
ServiceResult()
{}
BeginTransactionResult::BeginTransactionResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
BeginTransactionResult::~BeginTransactionResult()
{}
void BeginTransactionResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto dataNode = value["Data"];
if(!dataNode["TransactionId"].isNull())
data_.transactionId = dataNode["TransactionId"].asString();
if(!value["Success"].isNull())
success_ = value["Success"].asString() == "true";
if(!value["Code"].isNull())
code_ = value["Code"].asString();
if(!value["Message"].isNull())
message_ = value["Message"].asString();
}
std::string BeginTransactionResult::getMessage()const
{
return message_;
}
BeginTransactionResult::Data BeginTransactionResult::getData()const
{
return data_;
}
std::string BeginTransactionResult::getCode()const
{
return code_;
}
bool BeginTransactionResult::getSuccess()const
{
return success_;
}

View File

@@ -0,0 +1,54 @@
/*
* 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/rds-data/model/CommitTransactionRequest.h>
using AlibabaCloud::Rds_data::Model::CommitTransactionRequest;
CommitTransactionRequest::CommitTransactionRequest()
: RpcServiceRequest("rds-data", "2022-03-30", "CommitTransaction") {
setMethod(HttpRequest::Method::Post);
}
CommitTransactionRequest::~CommitTransactionRequest() {}
std::string CommitTransactionRequest::getTransactionId() const {
return transactionId_;
}
void CommitTransactionRequest::setTransactionId(const std::string &transactionId) {
transactionId_ = transactionId;
setBodyParameter(std::string("TransactionId"), transactionId);
}
std::string CommitTransactionRequest::getResourceArn() const {
return resourceArn_;
}
void CommitTransactionRequest::setResourceArn(const std::string &resourceArn) {
resourceArn_ = resourceArn;
setBodyParameter(std::string("ResourceArn"), resourceArn);
}
std::string CommitTransactionRequest::getSecretArn() const {
return secretArn_;
}
void CommitTransactionRequest::setSecretArn(const std::string &secretArn) {
secretArn_ = secretArn;
setBodyParameter(std::string("SecretArn"), secretArn);
}

View File

@@ -0,0 +1,73 @@
/*
* 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/rds-data/model/CommitTransactionResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Rds_data;
using namespace AlibabaCloud::Rds_data::Model;
CommitTransactionResult::CommitTransactionResult() :
ServiceResult()
{}
CommitTransactionResult::CommitTransactionResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
CommitTransactionResult::~CommitTransactionResult()
{}
void CommitTransactionResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto dataNode = value["Data"];
if(!dataNode["TransactionStatus"].isNull())
data_.transactionStatus = dataNode["TransactionStatus"].asString();
if(!value["Success"].isNull())
success_ = value["Success"].asString() == "true";
if(!value["Code"].isNull())
code_ = value["Code"].asString();
if(!value["Message"].isNull())
message_ = value["Message"].asString();
}
std::string CommitTransactionResult::getMessage()const
{
return message_;
}
CommitTransactionResult::Data CommitTransactionResult::getData()const
{
return data_;
}
std::string CommitTransactionResult::getCode()const
{
return code_;
}
bool CommitTransactionResult::getSuccess()const
{
return success_;
}

View File

@@ -0,0 +1,81 @@
/*
* 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/rds-data/model/DeleteRequest.h>
using AlibabaCloud::Rds_data::Model::DeleteRequest;
DeleteRequest::DeleteRequest()
: RpcServiceRequest("rds-data", "2022-03-30", "Delete") {
setMethod(HttpRequest::Method::Post);
}
DeleteRequest::~DeleteRequest() {}
std::string DeleteRequest::getTransactionId() const {
return transactionId_;
}
void DeleteRequest::setTransactionId(const std::string &transactionId) {
transactionId_ = transactionId;
setBodyParameter(std::string("TransactionId"), transactionId);
}
std::string DeleteRequest::getFilter() const {
return filter_;
}
void DeleteRequest::setFilter(const std::string &filter) {
filter_ = filter;
setBodyParameter(std::string("Filter"), filter);
}
std::string DeleteRequest::getDatabase() const {
return database_;
}
void DeleteRequest::setDatabase(const std::string &database) {
database_ = database;
setBodyParameter(std::string("Database"), database);
}
std::string DeleteRequest::getResourceArn() const {
return resourceArn_;
}
void DeleteRequest::setResourceArn(const std::string &resourceArn) {
resourceArn_ = resourceArn;
setBodyParameter(std::string("ResourceArn"), resourceArn);
}
std::string DeleteRequest::getTable() const {
return table_;
}
void DeleteRequest::setTable(const std::string &table) {
table_ = table;
setBodyParameter(std::string("Table"), table);
}
std::string DeleteRequest::getSecretArn() const {
return secretArn_;
}
void DeleteRequest::setSecretArn(const std::string &secretArn) {
secretArn_ = secretArn;
setBodyParameter(std::string("SecretArn"), secretArn);
}

View File

@@ -0,0 +1,73 @@
/*
* 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/rds-data/model/DeleteResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Rds_data;
using namespace AlibabaCloud::Rds_data::Model;
DeleteResult::DeleteResult() :
ServiceResult()
{}
DeleteResult::DeleteResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
DeleteResult::~DeleteResult()
{}
void DeleteResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto dataNode = value["Data"];
if(!dataNode["NumberOfRecordsUpdated"].isNull())
data_.numberOfRecordsUpdated = std::stol(dataNode["NumberOfRecordsUpdated"].asString());
if(!value["Success"].isNull())
success_ = value["Success"].asString() == "true";
if(!value["Code"].isNull())
code_ = value["Code"].asString();
if(!value["Message"].isNull())
message_ = value["Message"].asString();
}
std::string DeleteResult::getMessage()const
{
return message_;
}
DeleteResult::Data DeleteResult::getData()const
{
return data_;
}
std::string DeleteResult::getCode()const
{
return code_;
}
bool DeleteResult::getSuccess()const
{
return success_;
}

View File

@@ -0,0 +1,127 @@
/*
* 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/rds-data/model/ExecuteStatementRequest.h>
using AlibabaCloud::Rds_data::Model::ExecuteStatementRequest;
ExecuteStatementRequest::ExecuteStatementRequest()
: RpcServiceRequest("rds-data", "2022-03-30", "ExecuteStatement") {
setMethod(HttpRequest::Method::Post);
}
ExecuteStatementRequest::~ExecuteStatementRequest() {}
bool ExecuteStatementRequest::getIncludeResultMetadata() const {
return includeResultMetadata_;
}
void ExecuteStatementRequest::setIncludeResultMetadata(bool includeResultMetadata) {
includeResultMetadata_ = includeResultMetadata;
setBodyParameter(std::string("IncludeResultMetadata"), includeResultMetadata ? "true" : "false");
}
std::string ExecuteStatementRequest::getFormatRecordsAs() const {
return formatRecordsAs_;
}
void ExecuteStatementRequest::setFormatRecordsAs(const std::string &formatRecordsAs) {
formatRecordsAs_ = formatRecordsAs;
setBodyParameter(std::string("FormatRecordsAs"), formatRecordsAs);
}
std::string ExecuteStatementRequest::getTransactionId() const {
return transactionId_;
}
void ExecuteStatementRequest::setTransactionId(const std::string &transactionId) {
transactionId_ = transactionId;
setBodyParameter(std::string("TransactionId"), transactionId);
}
std::string ExecuteStatementRequest::getSql() const {
return sql_;
}
void ExecuteStatementRequest::setSql(const std::string &sql) {
sql_ = sql;
setBodyParameter(std::string("Sql"), sql);
}
ExecuteStatementRequest::ResultSetOptions ExecuteStatementRequest::getResultSetOptions() const {
return resultSetOptions_;
}
void ExecuteStatementRequest::setResultSetOptions(const ExecuteStatementRequest::ResultSetOptions &resultSetOptions) {
resultSetOptions_ = resultSetOptions;
setBodyParameter(std::string("ResultSetOptions") + ".DecimalReturnType", resultSetOptions.decimalReturnType);
setBodyParameter(std::string("ResultSetOptions") + ".LongReturnType", resultSetOptions.longReturnType);
}
std::string ExecuteStatementRequest::getDatabase() const {
return database_;
}
void ExecuteStatementRequest::setDatabase(const std::string &database) {
database_ = database;
setBodyParameter(std::string("Database"), database);
}
std::string ExecuteStatementRequest::getResourceArn() const {
return resourceArn_;
}
void ExecuteStatementRequest::setResourceArn(const std::string &resourceArn) {
resourceArn_ = resourceArn;
setBodyParameter(std::string("ResourceArn"), resourceArn);
}
std::vector<ExecuteStatementRequest::Parameters> ExecuteStatementRequest::getParameters() const {
return parameters_;
}
void ExecuteStatementRequest::setParameters(const std::vector<ExecuteStatementRequest::Parameters> &parameters) {
parameters_ = parameters;
for(int dep1 = 0; dep1 != parameters.size(); dep1++) {
setBodyParameter(std::string("Parameters") + "." + std::to_string(dep1 + 1) + ".Name", parameters[dep1].name);
setBodyParameter(std::string("Parameters") + "." + std::to_string(dep1 + 1) + ".TypeHint", parameters[dep1].typeHint);
setBodyParameter(std::string("Parameters") + "." + std::to_string(dep1 + 1) + ".Value.ArrayValue", parameters[dep1].value.arrayValue);
setBodyParameter(std::string("Parameters") + "." + std::to_string(dep1 + 1) + ".Value.BlobValue", parameters[dep1].value.blobValue);
setBodyParameter(std::string("Parameters") + "." + std::to_string(dep1 + 1) + ".Value.BooleanValue", parameters[dep1].value.booleanValue ? "true" : "false");
setBodyParameter(std::string("Parameters") + "." + std::to_string(dep1 + 1) + ".Value.IsNull", parameters[dep1].value.isNull ? "true" : "false");
setBodyParameter(std::string("Parameters") + "." + std::to_string(dep1 + 1) + ".Value.LongValue", std::to_string(parameters[dep1].value.longValue));
setBodyParameter(std::string("Parameters") + "." + std::to_string(dep1 + 1) + ".Value.StringValue", parameters[dep1].value.stringValue);
}
}
bool ExecuteStatementRequest::getContinueAfterTimeout() const {
return continueAfterTimeout_;
}
void ExecuteStatementRequest::setContinueAfterTimeout(bool continueAfterTimeout) {
continueAfterTimeout_ = continueAfterTimeout;
setBodyParameter(std::string("ContinueAfterTimeout"), continueAfterTimeout ? "true" : "false");
}
std::string ExecuteStatementRequest::getSecretArn() const {
return secretArn_;
}
void ExecuteStatementRequest::setSecretArn(const std::string &secretArn) {
secretArn_ = secretArn;
setBodyParameter(std::string("SecretArn"), secretArn);
}

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/rds-data/model/ExecuteStatementResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Rds_data;
using namespace AlibabaCloud::Rds_data::Model;
ExecuteStatementResult::ExecuteStatementResult() :
ServiceResult()
{}
ExecuteStatementResult::ExecuteStatementResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
ExecuteStatementResult::~ExecuteStatementResult()
{}
void ExecuteStatementResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
}

View File

@@ -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 <alibabacloud/rds-data/model/InsertListRequest.h>
using AlibabaCloud::Rds_data::Model::InsertListRequest;
InsertListRequest::InsertListRequest()
: RpcServiceRequest("rds-data", "2022-03-30", "InsertList") {
setMethod(HttpRequest::Method::Post);
}
InsertListRequest::~InsertListRequest() {}
std::vector<InsertListRequest::std::map<std::string, ObjectOfAny>> InsertListRequest::getRecords() const {
return records_;
}
void InsertListRequest::setRecords(const std::vector<InsertListRequest::std::map<std::string, ObjectOfAny>> &records) {
records_ = records;
for(int dep1 = 0; dep1 != records.size(); dep1++) {
for(auto const &iter2 : records[dep1]) {
setBodyParameter(std::string("Records") + "." + std::to_string(dep1 + 1) + "." + iter2.first, std::to_string(iter2.second));
}
}
}
std::string InsertListRequest::getTransactionId() const {
return transactionId_;
}
void InsertListRequest::setTransactionId(const std::string &transactionId) {
transactionId_ = transactionId;
setBodyParameter(std::string("TransactionId"), transactionId);
}
std::string InsertListRequest::getDatabase() const {
return database_;
}
void InsertListRequest::setDatabase(const std::string &database) {
database_ = database;
setBodyParameter(std::string("Database"), database);
}
std::string InsertListRequest::getResourceArn() const {
return resourceArn_;
}
void InsertListRequest::setResourceArn(const std::string &resourceArn) {
resourceArn_ = resourceArn;
setBodyParameter(std::string("ResourceArn"), resourceArn);
}
std::string InsertListRequest::getTable() const {
return table_;
}
void InsertListRequest::setTable(const std::string &table) {
table_ = table;
setBodyParameter(std::string("Table"), table);
}
std::string InsertListRequest::getSecretArn() const {
return secretArn_;
}
void InsertListRequest::setSecretArn(const std::string &secretArn) {
secretArn_ = secretArn;
setBodyParameter(std::string("SecretArn"), secretArn);
}

View File

@@ -0,0 +1,76 @@
/*
* 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/rds-data/model/InsertListResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Rds_data;
using namespace AlibabaCloud::Rds_data::Model;
InsertListResult::InsertListResult() :
ServiceResult()
{}
InsertListResult::InsertListResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
InsertListResult::~InsertListResult()
{}
void InsertListResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto dataNode = value["Data"];
if(!dataNode["NumberOfRecordsUpdated"].isNull())
data_.numberOfRecordsUpdated = std::stol(dataNode["NumberOfRecordsUpdated"].asString());
auto allAutoIncrementKeys = dataNode["AutoIncrementKeys"]["null"];
for (auto value : allAutoIncrementKeys)
data_.autoIncrementKeys.push_back(value.asString());
if(!value["Success"].isNull())
success_ = value["Success"].asString() == "true";
if(!value["Code"].isNull())
code_ = value["Code"].asString();
if(!value["Message"].isNull())
message_ = value["Message"].asString();
}
std::string InsertListResult::getMessage()const
{
return message_;
}
InsertListResult::Data InsertListResult::getData()const
{
return data_;
}
std::string InsertListResult::getCode()const
{
return code_;
}
bool InsertListResult::getSuccess()const
{
return success_;
}

View File

@@ -0,0 +1,83 @@
/*
* 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/rds-data/model/InsertRequest.h>
using AlibabaCloud::Rds_data::Model::InsertRequest;
InsertRequest::InsertRequest()
: RpcServiceRequest("rds-data", "2022-03-30", "Insert") {
setMethod(HttpRequest::Method::Post);
}
InsertRequest::~InsertRequest() {}
std::string InsertRequest::getTransactionId() const {
return transactionId_;
}
void InsertRequest::setTransactionId(const std::string &transactionId) {
transactionId_ = transactionId;
setBodyParameter(std::string("TransactionId"), transactionId);
}
std::string InsertRequest::getDatabase() const {
return database_;
}
void InsertRequest::setDatabase(const std::string &database) {
database_ = database;
setBodyParameter(std::string("Database"), database);
}
std::map<std::string, ObjectOfAny> InsertRequest::getRecord() const {
return record_;
}
void InsertRequest::setRecord(const std::map<std::string, ObjectOfAny> &record) {
record_ = record;
for(auto const &iter1 : record) {
setBodyParameter(std::string("Record") + "." + iter1.first, std::to_string(iter1.second));
}
}
std::string InsertRequest::getResourceArn() const {
return resourceArn_;
}
void InsertRequest::setResourceArn(const std::string &resourceArn) {
resourceArn_ = resourceArn;
setBodyParameter(std::string("ResourceArn"), resourceArn);
}
std::string InsertRequest::getTable() const {
return table_;
}
void InsertRequest::setTable(const std::string &table) {
table_ = table;
setBodyParameter(std::string("Table"), table);
}
std::string InsertRequest::getSecretArn() const {
return secretArn_;
}
void InsertRequest::setSecretArn(const std::string &secretArn) {
secretArn_ = secretArn;
setBodyParameter(std::string("SecretArn"), secretArn);
}

View File

@@ -0,0 +1,75 @@
/*
* 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/rds-data/model/InsertResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Rds_data;
using namespace AlibabaCloud::Rds_data::Model;
InsertResult::InsertResult() :
ServiceResult()
{}
InsertResult::InsertResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
InsertResult::~InsertResult()
{}
void InsertResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto dataNode = value["Data"];
if(!dataNode["NumberOfRecordsUpdated"].isNull())
data_.numberOfRecordsUpdated = std::stol(dataNode["NumberOfRecordsUpdated"].asString());
if(!dataNode["AutoIncrementKey"].isNull())
data_.autoIncrementKey = std::stol(dataNode["AutoIncrementKey"].asString());
if(!value["Success"].isNull())
success_ = value["Success"].asString() == "true";
if(!value["Code"].isNull())
code_ = value["Code"].asString();
if(!value["Message"].isNull())
message_ = value["Message"].asString();
}
std::string InsertResult::getMessage()const
{
return message_;
}
InsertResult::Data InsertResult::getData()const
{
return data_;
}
std::string InsertResult::getCode()const
{
return code_;
}
bool InsertResult::getSuccess()const
{
return success_;
}

View File

@@ -0,0 +1,54 @@
/*
* 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/rds-data/model/RollbackTransactionRequest.h>
using AlibabaCloud::Rds_data::Model::RollbackTransactionRequest;
RollbackTransactionRequest::RollbackTransactionRequest()
: RpcServiceRequest("rds-data", "2022-03-30", "RollbackTransaction") {
setMethod(HttpRequest::Method::Post);
}
RollbackTransactionRequest::~RollbackTransactionRequest() {}
std::string RollbackTransactionRequest::getTransactionId() const {
return transactionId_;
}
void RollbackTransactionRequest::setTransactionId(const std::string &transactionId) {
transactionId_ = transactionId;
setBodyParameter(std::string("TransactionId"), transactionId);
}
std::string RollbackTransactionRequest::getResourceArn() const {
return resourceArn_;
}
void RollbackTransactionRequest::setResourceArn(const std::string &resourceArn) {
resourceArn_ = resourceArn;
setBodyParameter(std::string("ResourceArn"), resourceArn);
}
std::string RollbackTransactionRequest::getSecretArn() const {
return secretArn_;
}
void RollbackTransactionRequest::setSecretArn(const std::string &secretArn) {
secretArn_ = secretArn;
setBodyParameter(std::string("SecretArn"), secretArn);
}

View File

@@ -0,0 +1,73 @@
/*
* 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/rds-data/model/RollbackTransactionResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Rds_data;
using namespace AlibabaCloud::Rds_data::Model;
RollbackTransactionResult::RollbackTransactionResult() :
ServiceResult()
{}
RollbackTransactionResult::RollbackTransactionResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
RollbackTransactionResult::~RollbackTransactionResult()
{}
void RollbackTransactionResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto dataNode = value["Data"];
if(!dataNode["TransactionStatus"].isNull())
data_.transactionStatus = dataNode["TransactionStatus"].asString();
if(!value["Success"].isNull())
success_ = value["Success"].asString() == "true";
if(!value["Code"].isNull())
code_ = value["Code"].asString();
if(!value["Message"].isNull())
message_ = value["Message"].asString();
}
std::string RollbackTransactionResult::getMessage()const
{
return message_;
}
RollbackTransactionResult::Data RollbackTransactionResult::getData()const
{
return data_;
}
std::string RollbackTransactionResult::getCode()const
{
return code_;
}
bool RollbackTransactionResult::getSuccess()const
{
return success_;
}

View File

@@ -0,0 +1,99 @@
/*
* 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/rds-data/model/SelectRequest.h>
using AlibabaCloud::Rds_data::Model::SelectRequest;
SelectRequest::SelectRequest()
: RpcServiceRequest("rds-data", "2022-03-30", "Select") {
setMethod(HttpRequest::Method::Post);
}
SelectRequest::~SelectRequest() {}
std::string SelectRequest::getTransactionId() const {
return transactionId_;
}
void SelectRequest::setTransactionId(const std::string &transactionId) {
transactionId_ = transactionId;
setBodyParameter(std::string("TransactionId"), transactionId);
}
long SelectRequest::getPageNumber() const {
return pageNumber_;
}
void SelectRequest::setPageNumber(long pageNumber) {
pageNumber_ = pageNumber;
setBodyParameter(std::string("PageNumber"), std::to_string(pageNumber));
}
std::string SelectRequest::getFilter() const {
return filter_;
}
void SelectRequest::setFilter(const std::string &filter) {
filter_ = filter;
setBodyParameter(std::string("Filter"), filter);
}
std::string SelectRequest::getDatabase() const {
return database_;
}
void SelectRequest::setDatabase(const std::string &database) {
database_ = database;
setBodyParameter(std::string("Database"), database);
}
long SelectRequest::getPageSize() const {
return pageSize_;
}
void SelectRequest::setPageSize(long pageSize) {
pageSize_ = pageSize;
setBodyParameter(std::string("PageSize"), std::to_string(pageSize));
}
std::string SelectRequest::getResourceArn() const {
return resourceArn_;
}
void SelectRequest::setResourceArn(const std::string &resourceArn) {
resourceArn_ = resourceArn;
setBodyParameter(std::string("ResourceArn"), resourceArn);
}
std::string SelectRequest::getTable() const {
return table_;
}
void SelectRequest::setTable(const std::string &table) {
table_ = table;
setBodyParameter(std::string("Table"), table);
}
std::string SelectRequest::getSecretArn() const {
return secretArn_;
}
void SelectRequest::setSecretArn(const std::string &secretArn) {
secretArn_ = secretArn;
setBodyParameter(std::string("SecretArn"), secretArn);
}

View File

@@ -0,0 +1,74 @@
/*
* 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/rds-data/model/SelectResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Rds_data;
using namespace AlibabaCloud::Rds_data::Model;
SelectResult::SelectResult() :
ServiceResult()
{}
SelectResult::SelectResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
SelectResult::~SelectResult()
{}
void SelectResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto dataNode = value["Data"];
auto allRecords = dataNode["Records"]["null"];
for (auto value : allRecords)
data_.records.push_back(value.asString());
if(!value["Success"].isNull())
success_ = value["Success"].asString() == "true";
if(!value["Code"].isNull())
code_ = value["Code"].asString();
if(!value["Message"].isNull())
message_ = value["Message"].asString();
}
std::string SelectResult::getMessage()const
{
return message_;
}
SelectResult::Data SelectResult::getData()const
{
return data_;
}
std::string SelectResult::getCode()const
{
return code_;
}
bool SelectResult::getSuccess()const
{
return success_;
}

View File

@@ -0,0 +1,92 @@
/*
* 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/rds-data/model/UpdateRequest.h>
using AlibabaCloud::Rds_data::Model::UpdateRequest;
UpdateRequest::UpdateRequest()
: RpcServiceRequest("rds-data", "2022-03-30", "Update") {
setMethod(HttpRequest::Method::Post);
}
UpdateRequest::~UpdateRequest() {}
std::string UpdateRequest::getTransactionId() const {
return transactionId_;
}
void UpdateRequest::setTransactionId(const std::string &transactionId) {
transactionId_ = transactionId;
setBodyParameter(std::string("TransactionId"), transactionId);
}
std::string UpdateRequest::getFilter() const {
return filter_;
}
void UpdateRequest::setFilter(const std::string &filter) {
filter_ = filter;
setBodyParameter(std::string("Filter"), filter);
}
std::string UpdateRequest::getDatabase() const {
return database_;
}
void UpdateRequest::setDatabase(const std::string &database) {
database_ = database;
setBodyParameter(std::string("Database"), database);
}
std::map<std::string, ObjectOfAny> UpdateRequest::getRecord() const {
return record_;
}
void UpdateRequest::setRecord(const std::map<std::string, ObjectOfAny> &record) {
record_ = record;
for(auto const &iter1 : record) {
setBodyParameter(std::string("Record") + "." + iter1.first, std::to_string(iter1.second));
}
}
std::string UpdateRequest::getResourceArn() const {
return resourceArn_;
}
void UpdateRequest::setResourceArn(const std::string &resourceArn) {
resourceArn_ = resourceArn;
setBodyParameter(std::string("ResourceArn"), resourceArn);
}
std::string UpdateRequest::getTable() const {
return table_;
}
void UpdateRequest::setTable(const std::string &table) {
table_ = table;
setBodyParameter(std::string("Table"), table);
}
std::string UpdateRequest::getSecretArn() const {
return secretArn_;
}
void UpdateRequest::setSecretArn(const std::string &secretArn) {
secretArn_ = secretArn;
setBodyParameter(std::string("SecretArn"), secretArn);
}

View File

@@ -0,0 +1,73 @@
/*
* 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/rds-data/model/UpdateResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Rds_data;
using namespace AlibabaCloud::Rds_data::Model;
UpdateResult::UpdateResult() :
ServiceResult()
{}
UpdateResult::UpdateResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
UpdateResult::~UpdateResult()
{}
void UpdateResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto dataNode = value["Data"];
if(!dataNode["NumberOfRecordsUpdated"].isNull())
data_.numberOfRecordsUpdated = std::stol(dataNode["NumberOfRecordsUpdated"].asString());
if(!value["Success"].isNull())
success_ = value["Success"].asString() == "true";
if(!value["Code"].isNull())
code_ = value["Code"].asString();
if(!value["Message"].isNull())
message_ = value["Message"].asString();
}
std::string UpdateResult::getMessage()const
{
return message_;
}
UpdateResult::Data UpdateResult::getData()const
{
return data_;
}
std::string UpdateResult::getCode()const
{
return code_;
}
bool UpdateResult::getSuccess()const
{
return success_;
}