diff --git a/VERSION b/VERSION index 8d61034a8..b18458eaa 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.1685 \ No newline at end of file +1.36.1686 \ No newline at end of file diff --git a/polardb/CMakeLists.txt b/polardb/CMakeLists.txt index 3eff9e4ea..3609c6ae4 100644 --- a/polardb/CMakeLists.txt +++ b/polardb/CMakeLists.txt @@ -29,6 +29,8 @@ set(polardb_public_header_model include/alibabacloud/polardb/model/CheckDBNameResult.h include/alibabacloud/polardb/model/CheckKMSAuthorizedRequest.h include/alibabacloud/polardb/model/CheckKMSAuthorizedResult.h + include/alibabacloud/polardb/model/CheckServiceLinkedRoleRequest.h + include/alibabacloud/polardb/model/CheckServiceLinkedRoleResult.h include/alibabacloud/polardb/model/CloseAITaskRequest.h include/alibabacloud/polardb/model/CloseAITaskResult.h include/alibabacloud/polardb/model/CloseDBClusterMigrationRequest.h @@ -55,6 +57,8 @@ set(polardb_public_header_model include/alibabacloud/polardb/model/CreateGlobalSecurityIPGroupResult.h include/alibabacloud/polardb/model/CreateParameterGroupRequest.h include/alibabacloud/polardb/model/CreateParameterGroupResult.h + include/alibabacloud/polardb/model/CreateServiceLinkedRoleRequest.h + include/alibabacloud/polardb/model/CreateServiceLinkedRoleResult.h include/alibabacloud/polardb/model/CreateStoragePlanRequest.h include/alibabacloud/polardb/model/CreateStoragePlanResult.h include/alibabacloud/polardb/model/DeleteAccountRequest.h @@ -306,6 +310,8 @@ set(polardb_src src/model/CheckDBNameResult.cc src/model/CheckKMSAuthorizedRequest.cc src/model/CheckKMSAuthorizedResult.cc + src/model/CheckServiceLinkedRoleRequest.cc + src/model/CheckServiceLinkedRoleResult.cc src/model/CloseAITaskRequest.cc src/model/CloseAITaskResult.cc src/model/CloseDBClusterMigrationRequest.cc @@ -332,6 +338,8 @@ set(polardb_src src/model/CreateGlobalSecurityIPGroupResult.cc src/model/CreateParameterGroupRequest.cc src/model/CreateParameterGroupResult.cc + src/model/CreateServiceLinkedRoleRequest.cc + src/model/CreateServiceLinkedRoleResult.cc src/model/CreateStoragePlanRequest.cc src/model/CreateStoragePlanResult.cc src/model/DeleteAccountRequest.cc diff --git a/polardb/include/alibabacloud/polardb/PolardbClient.h b/polardb/include/alibabacloud/polardb/PolardbClient.h index 57fd7cd1b..f02de40d4 100644 --- a/polardb/include/alibabacloud/polardb/PolardbClient.h +++ b/polardb/include/alibabacloud/polardb/PolardbClient.h @@ -30,6 +30,8 @@ #include "model/CheckDBNameResult.h" #include "model/CheckKMSAuthorizedRequest.h" #include "model/CheckKMSAuthorizedResult.h" +#include "model/CheckServiceLinkedRoleRequest.h" +#include "model/CheckServiceLinkedRoleResult.h" #include "model/CloseAITaskRequest.h" #include "model/CloseAITaskResult.h" #include "model/CloseDBClusterMigrationRequest.h" @@ -56,6 +58,8 @@ #include "model/CreateGlobalSecurityIPGroupResult.h" #include "model/CreateParameterGroupRequest.h" #include "model/CreateParameterGroupResult.h" +#include "model/CreateServiceLinkedRoleRequest.h" +#include "model/CreateServiceLinkedRoleResult.h" #include "model/CreateStoragePlanRequest.h" #include "model/CreateStoragePlanResult.h" #include "model/DeleteAccountRequest.h" @@ -317,6 +321,9 @@ namespace AlibabaCloud typedef Outcome CheckKMSAuthorizedOutcome; typedef std::future CheckKMSAuthorizedOutcomeCallable; typedef std::function&)> CheckKMSAuthorizedAsyncHandler; + typedef Outcome CheckServiceLinkedRoleOutcome; + typedef std::future CheckServiceLinkedRoleOutcomeCallable; + typedef std::function&)> CheckServiceLinkedRoleAsyncHandler; typedef Outcome CloseAITaskOutcome; typedef std::future CloseAITaskOutcomeCallable; typedef std::function&)> CloseAITaskAsyncHandler; @@ -356,6 +363,9 @@ namespace AlibabaCloud typedef Outcome CreateParameterGroupOutcome; typedef std::future CreateParameterGroupOutcomeCallable; typedef std::function&)> CreateParameterGroupAsyncHandler; + typedef Outcome CreateServiceLinkedRoleOutcome; + typedef std::future CreateServiceLinkedRoleOutcomeCallable; + typedef std::function&)> CreateServiceLinkedRoleAsyncHandler; typedef Outcome CreateStoragePlanOutcome; typedef std::future CreateStoragePlanOutcomeCallable; typedef std::function&)> CreateStoragePlanAsyncHandler; @@ -733,6 +743,9 @@ namespace AlibabaCloud CheckKMSAuthorizedOutcome checkKMSAuthorized(const Model::CheckKMSAuthorizedRequest &request)const; void checkKMSAuthorizedAsync(const Model::CheckKMSAuthorizedRequest& request, const CheckKMSAuthorizedAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; CheckKMSAuthorizedOutcomeCallable checkKMSAuthorizedCallable(const Model::CheckKMSAuthorizedRequest& request) const; + CheckServiceLinkedRoleOutcome checkServiceLinkedRole(const Model::CheckServiceLinkedRoleRequest &request)const; + void checkServiceLinkedRoleAsync(const Model::CheckServiceLinkedRoleRequest& request, const CheckServiceLinkedRoleAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + CheckServiceLinkedRoleOutcomeCallable checkServiceLinkedRoleCallable(const Model::CheckServiceLinkedRoleRequest& request) const; CloseAITaskOutcome closeAITask(const Model::CloseAITaskRequest &request)const; void closeAITaskAsync(const Model::CloseAITaskRequest& request, const CloseAITaskAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; CloseAITaskOutcomeCallable closeAITaskCallable(const Model::CloseAITaskRequest& request) const; @@ -772,6 +785,9 @@ namespace AlibabaCloud CreateParameterGroupOutcome createParameterGroup(const Model::CreateParameterGroupRequest &request)const; void createParameterGroupAsync(const Model::CreateParameterGroupRequest& request, const CreateParameterGroupAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; CreateParameterGroupOutcomeCallable createParameterGroupCallable(const Model::CreateParameterGroupRequest& request) const; + CreateServiceLinkedRoleOutcome createServiceLinkedRole(const Model::CreateServiceLinkedRoleRequest &request)const; + void createServiceLinkedRoleAsync(const Model::CreateServiceLinkedRoleRequest& request, const CreateServiceLinkedRoleAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + CreateServiceLinkedRoleOutcomeCallable createServiceLinkedRoleCallable(const Model::CreateServiceLinkedRoleRequest& request) const; CreateStoragePlanOutcome createStoragePlan(const Model::CreateStoragePlanRequest &request)const; void createStoragePlanAsync(const Model::CreateStoragePlanRequest& request, const CreateStoragePlanAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; CreateStoragePlanOutcomeCallable createStoragePlanCallable(const Model::CreateStoragePlanRequest& request) const; diff --git a/polardb/include/alibabacloud/polardb/model/CheckServiceLinkedRoleRequest.h b/polardb/include/alibabacloud/polardb/model/CheckServiceLinkedRoleRequest.h new file mode 100644 index 000000000..4845251b5 --- /dev/null +++ b/polardb/include/alibabacloud/polardb/model/CheckServiceLinkedRoleRequest.h @@ -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. + */ + +#ifndef ALIBABACLOUD_POLARDB_MODEL_CHECKSERVICELINKEDROLEREQUEST_H_ +#define ALIBABACLOUD_POLARDB_MODEL_CHECKSERVICELINKEDROLEREQUEST_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud { +namespace Polardb { +namespace Model { +class ALIBABACLOUD_POLARDB_EXPORT CheckServiceLinkedRoleRequest : public RpcServiceRequest { +public: + CheckServiceLinkedRoleRequest(); + ~CheckServiceLinkedRoleRequest(); + long getResourceOwnerId() const; + void setResourceOwnerId(long resourceOwnerId); + std::string getResourceOwnerAccount() const; + void setResourceOwnerAccount(const std::string &resourceOwnerAccount); + std::string getOwnerAccount() const; + void setOwnerAccount(const std::string &ownerAccount); + long getOwnerId() const; + void setOwnerId(long ownerId); + +private: + long resourceOwnerId_; + std::string resourceOwnerAccount_; + std::string ownerAccount_; + long ownerId_; +}; +} // namespace Model +} // namespace Polardb +} // namespace AlibabaCloud +#endif // !ALIBABACLOUD_POLARDB_MODEL_CHECKSERVICELINKEDROLEREQUEST_H_ diff --git a/polardb/include/alibabacloud/polardb/model/CheckServiceLinkedRoleResult.h b/polardb/include/alibabacloud/polardb/model/CheckServiceLinkedRoleResult.h new file mode 100644 index 000000000..d54bba845 --- /dev/null +++ b/polardb/include/alibabacloud/polardb/model/CheckServiceLinkedRoleResult.h @@ -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. + */ + +#ifndef ALIBABACLOUD_POLARDB_MODEL_CHECKSERVICELINKEDROLERESULT_H_ +#define ALIBABACLOUD_POLARDB_MODEL_CHECKSERVICELINKEDROLERESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Polardb + { + namespace Model + { + class ALIBABACLOUD_POLARDB_EXPORT CheckServiceLinkedRoleResult : public ServiceResult + { + public: + + + CheckServiceLinkedRoleResult(); + explicit CheckServiceLinkedRoleResult(const std::string &payload); + ~CheckServiceLinkedRoleResult(); + bool getHasServiceLinkedRole()const; + + protected: + void parse(const std::string &payload); + private: + bool hasServiceLinkedRole_; + + }; + } + } +} +#endif // !ALIBABACLOUD_POLARDB_MODEL_CHECKSERVICELINKEDROLERESULT_H_ \ No newline at end of file diff --git a/polardb/include/alibabacloud/polardb/model/CreateServiceLinkedRoleRequest.h b/polardb/include/alibabacloud/polardb/model/CreateServiceLinkedRoleRequest.h new file mode 100644 index 000000000..123e4adc5 --- /dev/null +++ b/polardb/include/alibabacloud/polardb/model/CreateServiceLinkedRoleRequest.h @@ -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. + */ + +#ifndef ALIBABACLOUD_POLARDB_MODEL_CREATESERVICELINKEDROLEREQUEST_H_ +#define ALIBABACLOUD_POLARDB_MODEL_CREATESERVICELINKEDROLEREQUEST_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud { +namespace Polardb { +namespace Model { +class ALIBABACLOUD_POLARDB_EXPORT CreateServiceLinkedRoleRequest : public RpcServiceRequest { +public: + CreateServiceLinkedRoleRequest(); + ~CreateServiceLinkedRoleRequest(); + long getResourceOwnerId() const; + void setResourceOwnerId(long resourceOwnerId); + std::string getResourceOwnerAccount() const; + void setResourceOwnerAccount(const std::string &resourceOwnerAccount); + std::string getOwnerAccount() const; + void setOwnerAccount(const std::string &ownerAccount); + long getOwnerId() const; + void setOwnerId(long ownerId); + +private: + long resourceOwnerId_; + std::string resourceOwnerAccount_; + std::string ownerAccount_; + long ownerId_; +}; +} // namespace Model +} // namespace Polardb +} // namespace AlibabaCloud +#endif // !ALIBABACLOUD_POLARDB_MODEL_CREATESERVICELINKEDROLEREQUEST_H_ diff --git a/polardb/include/alibabacloud/polardb/model/CreateServiceLinkedRoleResult.h b/polardb/include/alibabacloud/polardb/model/CreateServiceLinkedRoleResult.h new file mode 100644 index 000000000..257e6e4d8 --- /dev/null +++ b/polardb/include/alibabacloud/polardb/model/CreateServiceLinkedRoleResult.h @@ -0,0 +1,49 @@ +/* + * 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_POLARDB_MODEL_CREATESERVICELINKEDROLERESULT_H_ +#define ALIBABACLOUD_POLARDB_MODEL_CREATESERVICELINKEDROLERESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Polardb + { + namespace Model + { + class ALIBABACLOUD_POLARDB_EXPORT CreateServiceLinkedRoleResult : public ServiceResult + { + public: + + + CreateServiceLinkedRoleResult(); + explicit CreateServiceLinkedRoleResult(const std::string &payload); + ~CreateServiceLinkedRoleResult(); + + protected: + void parse(const std::string &payload); + private: + + }; + } + } +} +#endif // !ALIBABACLOUD_POLARDB_MODEL_CREATESERVICELINKEDROLERESULT_H_ \ No newline at end of file diff --git a/polardb/src/PolardbClient.cc b/polardb/src/PolardbClient.cc index 62382e03d..a05fd2f40 100644 --- a/polardb/src/PolardbClient.cc +++ b/polardb/src/PolardbClient.cc @@ -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& 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>( + [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& 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>( + [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(); diff --git a/polardb/src/model/CheckServiceLinkedRoleRequest.cc b/polardb/src/model/CheckServiceLinkedRoleRequest.cc new file mode 100644 index 000000000..43493843e --- /dev/null +++ b/polardb/src/model/CheckServiceLinkedRoleRequest.cc @@ -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 + +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)); +} + diff --git a/polardb/src/model/CheckServiceLinkedRoleResult.cc b/polardb/src/model/CheckServiceLinkedRoleResult.cc new file mode 100644 index 000000000..4c4315aeb --- /dev/null +++ b/polardb/src/model/CheckServiceLinkedRoleResult.cc @@ -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 +#include + +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_; +} + diff --git a/polardb/src/model/CreateServiceLinkedRoleRequest.cc b/polardb/src/model/CreateServiceLinkedRoleRequest.cc new file mode 100644 index 000000000..5dabef14d --- /dev/null +++ b/polardb/src/model/CreateServiceLinkedRoleRequest.cc @@ -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 + +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)); +} + diff --git a/polardb/src/model/CreateServiceLinkedRoleResult.cc b/polardb/src/model/CreateServiceLinkedRoleResult.cc new file mode 100644 index 000000000..184652ed7 --- /dev/null +++ b/polardb/src/model/CreateServiceLinkedRoleResult.cc @@ -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 +#include + +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()); + +} +