diff --git a/CHANGELOG b/CHANGELOG index ccef11c59..1512b0432 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,7 @@ +2019-11-14 Version 1.36.175 +- Support Tag OpenAPI. +- Fix endpoint problem. + 2019-11-14 Version 1.36.174 - Initial construction. - Public beta version. diff --git a/VERSION b/VERSION index 462cef47e..ea760474f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.174 \ No newline at end of file +1.36.175 \ No newline at end of file diff --git a/adb/CMakeLists.txt b/adb/CMakeLists.txt index 069e33eea..f83fc078d 100644 --- a/adb/CMakeLists.txt +++ b/adb/CMakeLists.txt @@ -57,6 +57,8 @@ set(adb_public_header_model include/alibabacloud/adb/model/DescribeSlowLogTrendResult.h include/alibabacloud/adb/model/GrantOperatorPermissionRequest.h include/alibabacloud/adb/model/GrantOperatorPermissionResult.h + include/alibabacloud/adb/model/ListTagResourcesRequest.h + include/alibabacloud/adb/model/ListTagResourcesResult.h include/alibabacloud/adb/model/ModifyAccountDescriptionRequest.h include/alibabacloud/adb/model/ModifyAccountDescriptionResult.h include/alibabacloud/adb/model/ModifyAutoRenewAttributeRequest.h @@ -72,7 +74,11 @@ set(adb_public_header_model include/alibabacloud/adb/model/ResetAccountPasswordRequest.h include/alibabacloud/adb/model/ResetAccountPasswordResult.h include/alibabacloud/adb/model/RevokeOperatorPermissionRequest.h - include/alibabacloud/adb/model/RevokeOperatorPermissionResult.h ) + include/alibabacloud/adb/model/RevokeOperatorPermissionResult.h + include/alibabacloud/adb/model/TagResourcesRequest.h + include/alibabacloud/adb/model/TagResourcesResult.h + include/alibabacloud/adb/model/UntagResourcesRequest.h + include/alibabacloud/adb/model/UntagResourcesResult.h ) set(adb_src src/AdbClient.cc @@ -112,6 +118,8 @@ set(adb_src src/model/DescribeSlowLogTrendResult.cc src/model/GrantOperatorPermissionRequest.cc src/model/GrantOperatorPermissionResult.cc + src/model/ListTagResourcesRequest.cc + src/model/ListTagResourcesResult.cc src/model/ModifyAccountDescriptionRequest.cc src/model/ModifyAccountDescriptionResult.cc src/model/ModifyAutoRenewAttributeRequest.cc @@ -127,7 +135,11 @@ set(adb_src src/model/ResetAccountPasswordRequest.cc src/model/ResetAccountPasswordResult.cc src/model/RevokeOperatorPermissionRequest.cc - src/model/RevokeOperatorPermissionResult.cc ) + src/model/RevokeOperatorPermissionResult.cc + src/model/TagResourcesRequest.cc + src/model/TagResourcesResult.cc + src/model/UntagResourcesRequest.cc + src/model/UntagResourcesResult.cc ) add_library(adb ${LIB_TYPE} ${adb_public_header} diff --git a/adb/include/alibabacloud/adb/AdbClient.h b/adb/include/alibabacloud/adb/AdbClient.h index 298f99020..c70085dbc 100644 --- a/adb/include/alibabacloud/adb/AdbClient.h +++ b/adb/include/alibabacloud/adb/AdbClient.h @@ -58,6 +58,8 @@ #include "model/DescribeSlowLogTrendResult.h" #include "model/GrantOperatorPermissionRequest.h" #include "model/GrantOperatorPermissionResult.h" +#include "model/ListTagResourcesRequest.h" +#include "model/ListTagResourcesResult.h" #include "model/ModifyAccountDescriptionRequest.h" #include "model/ModifyAccountDescriptionResult.h" #include "model/ModifyAutoRenewAttributeRequest.h" @@ -74,6 +76,10 @@ #include "model/ResetAccountPasswordResult.h" #include "model/RevokeOperatorPermissionRequest.h" #include "model/RevokeOperatorPermissionResult.h" +#include "model/TagResourcesRequest.h" +#include "model/TagResourcesResult.h" +#include "model/UntagResourcesRequest.h" +#include "model/UntagResourcesResult.h" namespace AlibabaCloud @@ -137,6 +143,9 @@ namespace AlibabaCloud typedef Outcome GrantOperatorPermissionOutcome; typedef std::future GrantOperatorPermissionOutcomeCallable; typedef std::function&)> GrantOperatorPermissionAsyncHandler; + typedef Outcome ListTagResourcesOutcome; + typedef std::future ListTagResourcesOutcomeCallable; + typedef std::function&)> ListTagResourcesAsyncHandler; typedef Outcome ModifyAccountDescriptionOutcome; typedef std::future ModifyAccountDescriptionOutcomeCallable; typedef std::function&)> ModifyAccountDescriptionAsyncHandler; @@ -161,6 +170,12 @@ namespace AlibabaCloud typedef Outcome RevokeOperatorPermissionOutcome; typedef std::future RevokeOperatorPermissionOutcomeCallable; typedef std::function&)> RevokeOperatorPermissionAsyncHandler; + typedef Outcome TagResourcesOutcome; + typedef std::future TagResourcesOutcomeCallable; + typedef std::function&)> TagResourcesAsyncHandler; + typedef Outcome UntagResourcesOutcome; + typedef std::future UntagResourcesOutcomeCallable; + typedef std::function&)> UntagResourcesAsyncHandler; AdbClient(const Credentials &credentials, const ClientConfiguration &configuration); AdbClient(const std::shared_ptr &credentialsProvider, const ClientConfiguration &configuration); @@ -220,6 +235,9 @@ namespace AlibabaCloud GrantOperatorPermissionOutcome grantOperatorPermission(const Model::GrantOperatorPermissionRequest &request)const; void grantOperatorPermissionAsync(const Model::GrantOperatorPermissionRequest& request, const GrantOperatorPermissionAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; GrantOperatorPermissionOutcomeCallable grantOperatorPermissionCallable(const Model::GrantOperatorPermissionRequest& request) const; + ListTagResourcesOutcome listTagResources(const Model::ListTagResourcesRequest &request)const; + void listTagResourcesAsync(const Model::ListTagResourcesRequest& request, const ListTagResourcesAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + ListTagResourcesOutcomeCallable listTagResourcesCallable(const Model::ListTagResourcesRequest& request) const; ModifyAccountDescriptionOutcome modifyAccountDescription(const Model::ModifyAccountDescriptionRequest &request)const; void modifyAccountDescriptionAsync(const Model::ModifyAccountDescriptionRequest& request, const ModifyAccountDescriptionAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; ModifyAccountDescriptionOutcomeCallable modifyAccountDescriptionCallable(const Model::ModifyAccountDescriptionRequest& request) const; @@ -244,6 +262,12 @@ namespace AlibabaCloud RevokeOperatorPermissionOutcome revokeOperatorPermission(const Model::RevokeOperatorPermissionRequest &request)const; void revokeOperatorPermissionAsync(const Model::RevokeOperatorPermissionRequest& request, const RevokeOperatorPermissionAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; RevokeOperatorPermissionOutcomeCallable revokeOperatorPermissionCallable(const Model::RevokeOperatorPermissionRequest& request) const; + TagResourcesOutcome tagResources(const Model::TagResourcesRequest &request)const; + void tagResourcesAsync(const Model::TagResourcesRequest& request, const TagResourcesAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + TagResourcesOutcomeCallable tagResourcesCallable(const Model::TagResourcesRequest& request) const; + UntagResourcesOutcome untagResources(const Model::UntagResourcesRequest &request)const; + void untagResourcesAsync(const Model::UntagResourcesRequest& request, const UntagResourcesAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + UntagResourcesOutcomeCallable untagResourcesCallable(const Model::UntagResourcesRequest& request) const; private: std::shared_ptr endpointProvider_; diff --git a/adb/include/alibabacloud/adb/model/ListTagResourcesRequest.h b/adb/include/alibabacloud/adb/model/ListTagResourcesRequest.h new file mode 100644 index 000000000..14834b6f4 --- /dev/null +++ b/adb/include/alibabacloud/adb/model/ListTagResourcesRequest.h @@ -0,0 +1,80 @@ +/* + * 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_ADB_MODEL_LISTTAGRESOURCESREQUEST_H_ +#define ALIBABACLOUD_ADB_MODEL_LISTTAGRESOURCESREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Adb + { + namespace Model + { + class ALIBABACLOUD_ADB_EXPORT ListTagResourcesRequest : public RpcServiceRequest + { + struct Tag + { + std::string value; + std::string key; + }; + + public: + ListTagResourcesRequest(); + ~ListTagResourcesRequest(); + + long getResourceOwnerId()const; + void setResourceOwnerId(long resourceOwnerId); + std::string getAccessKeyId()const; + void setAccessKeyId(const std::string& accessKeyId); + std::string getRegionId()const; + void setRegionId(const std::string& regionId); + std::string getNextToken()const; + void setNextToken(const std::string& nextToken); + std::vector getTag()const; + void setTag(const std::vector& tag); + std::vector getResourceId()const; + void setResourceId(const std::vector& resourceId); + 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); + std::string getResourceType()const; + void setResourceType(const std::string& resourceType); + + private: + long resourceOwnerId_; + std::string accessKeyId_; + std::string regionId_; + std::string nextToken_; + std::vector tag_; + std::vector resourceId_; + std::string resourceOwnerAccount_; + std::string ownerAccount_; + long ownerId_; + std::string resourceType_; + + }; + } + } +} +#endif // !ALIBABACLOUD_ADB_MODEL_LISTTAGRESOURCESREQUEST_H_ \ No newline at end of file diff --git a/adb/include/alibabacloud/adb/model/ListTagResourcesResult.h b/adb/include/alibabacloud/adb/model/ListTagResourcesResult.h new file mode 100644 index 000000000..047cd9120 --- /dev/null +++ b/adb/include/alibabacloud/adb/model/ListTagResourcesResult.h @@ -0,0 +1,60 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_ADB_MODEL_LISTTAGRESOURCESRESULT_H_ +#define ALIBABACLOUD_ADB_MODEL_LISTTAGRESOURCESRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Adb + { + namespace Model + { + class ALIBABACLOUD_ADB_EXPORT ListTagResourcesResult : public ServiceResult + { + public: + struct TagResource + { + std::string resourceId; + std::string tagKey; + std::string resourceType; + std::string tagValue; + }; + + + ListTagResourcesResult(); + explicit ListTagResourcesResult(const std::string &payload); + ~ListTagResourcesResult(); + std::string getNextToken()const; + std::vector getTagResources()const; + + protected: + void parse(const std::string &payload); + private: + std::string nextToken_; + std::vector tagResources_; + + }; + } + } +} +#endif // !ALIBABACLOUD_ADB_MODEL_LISTTAGRESOURCESRESULT_H_ \ No newline at end of file diff --git a/adb/include/alibabacloud/adb/model/TagResourcesRequest.h b/adb/include/alibabacloud/adb/model/TagResourcesRequest.h new file mode 100644 index 000000000..91f24d687 --- /dev/null +++ b/adb/include/alibabacloud/adb/model/TagResourcesRequest.h @@ -0,0 +1,77 @@ +/* + * 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_ADB_MODEL_TAGRESOURCESREQUEST_H_ +#define ALIBABACLOUD_ADB_MODEL_TAGRESOURCESREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Adb + { + namespace Model + { + class ALIBABACLOUD_ADB_EXPORT TagResourcesRequest : public RpcServiceRequest + { + struct Tag + { + std::string value; + std::string key; + }; + + public: + TagResourcesRequest(); + ~TagResourcesRequest(); + + long getResourceOwnerId()const; + void setResourceOwnerId(long resourceOwnerId); + std::string getAccessKeyId()const; + void setAccessKeyId(const std::string& accessKeyId); + std::string getRegionId()const; + void setRegionId(const std::string& regionId); + std::vector getTag()const; + void setTag(const std::vector& tag); + std::vector getResourceId()const; + void setResourceId(const std::vector& resourceId); + 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); + std::string getResourceType()const; + void setResourceType(const std::string& resourceType); + + private: + long resourceOwnerId_; + std::string accessKeyId_; + std::string regionId_; + std::vector tag_; + std::vector resourceId_; + std::string resourceOwnerAccount_; + std::string ownerAccount_; + long ownerId_; + std::string resourceType_; + + }; + } + } +} +#endif // !ALIBABACLOUD_ADB_MODEL_TAGRESOURCESREQUEST_H_ \ No newline at end of file diff --git a/adb/include/alibabacloud/adb/model/TagResourcesResult.h b/adb/include/alibabacloud/adb/model/TagResourcesResult.h new file mode 100644 index 000000000..81f90dcb3 --- /dev/null +++ b/adb/include/alibabacloud/adb/model/TagResourcesResult.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_ADB_MODEL_TAGRESOURCESRESULT_H_ +#define ALIBABACLOUD_ADB_MODEL_TAGRESOURCESRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Adb + { + namespace Model + { + class ALIBABACLOUD_ADB_EXPORT TagResourcesResult : public ServiceResult + { + public: + + + TagResourcesResult(); + explicit TagResourcesResult(const std::string &payload); + ~TagResourcesResult(); + + protected: + void parse(const std::string &payload); + private: + + }; + } + } +} +#endif // !ALIBABACLOUD_ADB_MODEL_TAGRESOURCESRESULT_H_ \ No newline at end of file diff --git a/adb/include/alibabacloud/adb/model/UntagResourcesRequest.h b/adb/include/alibabacloud/adb/model/UntagResourcesRequest.h new file mode 100644 index 000000000..53974506e --- /dev/null +++ b/adb/include/alibabacloud/adb/model/UntagResourcesRequest.h @@ -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. + */ + +#ifndef ALIBABACLOUD_ADB_MODEL_UNTAGRESOURCESREQUEST_H_ +#define ALIBABACLOUD_ADB_MODEL_UNTAGRESOURCESREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Adb + { + namespace Model + { + class ALIBABACLOUD_ADB_EXPORT UntagResourcesRequest : public RpcServiceRequest + { + + public: + UntagResourcesRequest(); + ~UntagResourcesRequest(); + + long getResourceOwnerId()const; + void setResourceOwnerId(long resourceOwnerId); + std::string getAccessKeyId()const; + void setAccessKeyId(const std::string& accessKeyId); + std::string getRegionId()const; + void setRegionId(const std::string& regionId); + bool getAll()const; + void setAll(bool all); + std::vector getResourceId()const; + void setResourceId(const std::vector& resourceId); + 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); + std::string getResourceType()const; + void setResourceType(const std::string& resourceType); + std::vector getTagKey()const; + void setTagKey(const std::vector& tagKey); + + private: + long resourceOwnerId_; + std::string accessKeyId_; + std::string regionId_; + bool all_; + std::vector resourceId_; + std::string resourceOwnerAccount_; + std::string ownerAccount_; + long ownerId_; + std::string resourceType_; + std::vector tagKey_; + + }; + } + } +} +#endif // !ALIBABACLOUD_ADB_MODEL_UNTAGRESOURCESREQUEST_H_ \ No newline at end of file diff --git a/adb/include/alibabacloud/adb/model/UntagResourcesResult.h b/adb/include/alibabacloud/adb/model/UntagResourcesResult.h new file mode 100644 index 000000000..4284e2afd --- /dev/null +++ b/adb/include/alibabacloud/adb/model/UntagResourcesResult.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_ADB_MODEL_UNTAGRESOURCESRESULT_H_ +#define ALIBABACLOUD_ADB_MODEL_UNTAGRESOURCESRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Adb + { + namespace Model + { + class ALIBABACLOUD_ADB_EXPORT UntagResourcesResult : public ServiceResult + { + public: + + + UntagResourcesResult(); + explicit UntagResourcesResult(const std::string &payload); + ~UntagResourcesResult(); + + protected: + void parse(const std::string &payload); + private: + + }; + } + } +} +#endif // !ALIBABACLOUD_ADB_MODEL_UNTAGRESOURCESRESULT_H_ \ No newline at end of file diff --git a/adb/src/AdbClient.cc b/adb/src/AdbClient.cc index a675dcc30..3817d5a7f 100644 --- a/adb/src/AdbClient.cc +++ b/adb/src/AdbClient.cc @@ -699,6 +699,42 @@ AdbClient::GrantOperatorPermissionOutcomeCallable AdbClient::grantOperatorPermis return task->get_future(); } +AdbClient::ListTagResourcesOutcome AdbClient::listTagResources(const ListTagResourcesRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return ListTagResourcesOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return ListTagResourcesOutcome(ListTagResourcesResult(outcome.result())); + else + return ListTagResourcesOutcome(outcome.error()); +} + +void AdbClient::listTagResourcesAsync(const ListTagResourcesRequest& request, const ListTagResourcesAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, listTagResources(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +AdbClient::ListTagResourcesOutcomeCallable AdbClient::listTagResourcesCallable(const ListTagResourcesRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->listTagResources(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + AdbClient::ModifyAccountDescriptionOutcome AdbClient::modifyAccountDescription(const ModifyAccountDescriptionRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); @@ -987,3 +1023,75 @@ AdbClient::RevokeOperatorPermissionOutcomeCallable AdbClient::revokeOperatorPerm return task->get_future(); } +AdbClient::TagResourcesOutcome AdbClient::tagResources(const TagResourcesRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return TagResourcesOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return TagResourcesOutcome(TagResourcesResult(outcome.result())); + else + return TagResourcesOutcome(outcome.error()); +} + +void AdbClient::tagResourcesAsync(const TagResourcesRequest& request, const TagResourcesAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, tagResources(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +AdbClient::TagResourcesOutcomeCallable AdbClient::tagResourcesCallable(const TagResourcesRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->tagResources(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +AdbClient::UntagResourcesOutcome AdbClient::untagResources(const UntagResourcesRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return UntagResourcesOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return UntagResourcesOutcome(UntagResourcesResult(outcome.result())); + else + return UntagResourcesOutcome(outcome.error()); +} + +void AdbClient::untagResourcesAsync(const UntagResourcesRequest& request, const UntagResourcesAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, untagResources(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +AdbClient::UntagResourcesOutcomeCallable AdbClient::untagResourcesCallable(const UntagResourcesRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->untagResources(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + diff --git a/adb/src/model/ListTagResourcesRequest.cc b/adb/src/model/ListTagResourcesRequest.cc new file mode 100644 index 000000000..a64d793bb --- /dev/null +++ b/adb/src/model/ListTagResourcesRequest.cc @@ -0,0 +1,146 @@ +/* + * 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::Adb::Model::ListTagResourcesRequest; + +ListTagResourcesRequest::ListTagResourcesRequest() : + RpcServiceRequest("adb", "2019-03-15", "ListTagResources") +{ + setMethod(HttpRequest::Method::Post); +} + +ListTagResourcesRequest::~ListTagResourcesRequest() +{} + +long ListTagResourcesRequest::getResourceOwnerId()const +{ + return resourceOwnerId_; +} + +void ListTagResourcesRequest::setResourceOwnerId(long resourceOwnerId) +{ + resourceOwnerId_ = resourceOwnerId; + setCoreParameter("ResourceOwnerId", std::to_string(resourceOwnerId)); +} + +std::string ListTagResourcesRequest::getAccessKeyId()const +{ + return accessKeyId_; +} + +void ListTagResourcesRequest::setAccessKeyId(const std::string& accessKeyId) +{ + accessKeyId_ = accessKeyId; + setCoreParameter("AccessKeyId", accessKeyId); +} + +std::string ListTagResourcesRequest::getRegionId()const +{ + return regionId_; +} + +void ListTagResourcesRequest::setRegionId(const std::string& regionId) +{ + regionId_ = regionId; + setCoreParameter("RegionId", regionId); +} + +std::string ListTagResourcesRequest::getNextToken()const +{ + return nextToken_; +} + +void ListTagResourcesRequest::setNextToken(const std::string& nextToken) +{ + nextToken_ = nextToken; + setCoreParameter("NextToken", nextToken); +} + +std::vector ListTagResourcesRequest::getTag()const +{ + return tag_; +} + +void ListTagResourcesRequest::setTag(const std::vector& tag) +{ + tag_ = tag; + int i = 0; + for(int i = 0; i!= tag.size(); i++) { + auto obj = tag.at(i); + std::string str ="Tag."+ std::to_string(i); + setCoreParameter(str + ".Value", obj.value); + setCoreParameter(str + ".Key", obj.key); + } +} + +std::vector ListTagResourcesRequest::getResourceId()const +{ + return resourceId_; +} + +void ListTagResourcesRequest::setResourceId(const std::vector& resourceId) +{ + resourceId_ = resourceId; + for(int i = 0; i!= resourceId.size(); i++) + setCoreParameter("ResourceId."+ std::to_string(i), resourceId.at(i)); +} + +std::string ListTagResourcesRequest::getResourceOwnerAccount()const +{ + return resourceOwnerAccount_; +} + +void ListTagResourcesRequest::setResourceOwnerAccount(const std::string& resourceOwnerAccount) +{ + resourceOwnerAccount_ = resourceOwnerAccount; + setCoreParameter("ResourceOwnerAccount", resourceOwnerAccount); +} + +std::string ListTagResourcesRequest::getOwnerAccount()const +{ + return ownerAccount_; +} + +void ListTagResourcesRequest::setOwnerAccount(const std::string& ownerAccount) +{ + ownerAccount_ = ownerAccount; + setCoreParameter("OwnerAccount", ownerAccount); +} + +long ListTagResourcesRequest::getOwnerId()const +{ + return ownerId_; +} + +void ListTagResourcesRequest::setOwnerId(long ownerId) +{ + ownerId_ = ownerId; + setCoreParameter("OwnerId", std::to_string(ownerId)); +} + +std::string ListTagResourcesRequest::getResourceType()const +{ + return resourceType_; +} + +void ListTagResourcesRequest::setResourceType(const std::string& resourceType) +{ + resourceType_ = resourceType; + setCoreParameter("ResourceType", resourceType); +} + diff --git a/adb/src/model/ListTagResourcesResult.cc b/adb/src/model/ListTagResourcesResult.cc new file mode 100644 index 000000000..e336c81b3 --- /dev/null +++ b/adb/src/model/ListTagResourcesResult.cc @@ -0,0 +1,70 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +using namespace AlibabaCloud::Adb; +using namespace AlibabaCloud::Adb::Model; + +ListTagResourcesResult::ListTagResourcesResult() : + ServiceResult() +{} + +ListTagResourcesResult::ListTagResourcesResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +ListTagResourcesResult::~ListTagResourcesResult() +{} + +void ListTagResourcesResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto allTagResourcesNode = value["TagResources"]["TagResource"]; + for (auto valueTagResourcesTagResource : allTagResourcesNode) + { + TagResource tagResourcesObject; + if(!valueTagResourcesTagResource["TagKey"].isNull()) + tagResourcesObject.tagKey = valueTagResourcesTagResource["TagKey"].asString(); + if(!valueTagResourcesTagResource["TagValue"].isNull()) + tagResourcesObject.tagValue = valueTagResourcesTagResource["TagValue"].asString(); + if(!valueTagResourcesTagResource["ResourceType"].isNull()) + tagResourcesObject.resourceType = valueTagResourcesTagResource["ResourceType"].asString(); + if(!valueTagResourcesTagResource["ResourceId"].isNull()) + tagResourcesObject.resourceId = valueTagResourcesTagResource["ResourceId"].asString(); + tagResources_.push_back(tagResourcesObject); + } + if(!value["NextToken"].isNull()) + nextToken_ = value["NextToken"].asString(); + +} + +std::string ListTagResourcesResult::getNextToken()const +{ + return nextToken_; +} + +std::vector ListTagResourcesResult::getTagResources()const +{ + return tagResources_; +} + diff --git a/adb/src/model/TagResourcesRequest.cc b/adb/src/model/TagResourcesRequest.cc new file mode 100644 index 000000000..7c552103d --- /dev/null +++ b/adb/src/model/TagResourcesRequest.cc @@ -0,0 +1,135 @@ +/* + * 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::Adb::Model::TagResourcesRequest; + +TagResourcesRequest::TagResourcesRequest() : + RpcServiceRequest("adb", "2019-03-15", "TagResources") +{ + setMethod(HttpRequest::Method::Post); +} + +TagResourcesRequest::~TagResourcesRequest() +{} + +long TagResourcesRequest::getResourceOwnerId()const +{ + return resourceOwnerId_; +} + +void TagResourcesRequest::setResourceOwnerId(long resourceOwnerId) +{ + resourceOwnerId_ = resourceOwnerId; + setCoreParameter("ResourceOwnerId", std::to_string(resourceOwnerId)); +} + +std::string TagResourcesRequest::getAccessKeyId()const +{ + return accessKeyId_; +} + +void TagResourcesRequest::setAccessKeyId(const std::string& accessKeyId) +{ + accessKeyId_ = accessKeyId; + setCoreParameter("AccessKeyId", accessKeyId); +} + +std::string TagResourcesRequest::getRegionId()const +{ + return regionId_; +} + +void TagResourcesRequest::setRegionId(const std::string& regionId) +{ + regionId_ = regionId; + setCoreParameter("RegionId", regionId); +} + +std::vector TagResourcesRequest::getTag()const +{ + return tag_; +} + +void TagResourcesRequest::setTag(const std::vector& tag) +{ + tag_ = tag; + int i = 0; + for(int i = 0; i!= tag.size(); i++) { + auto obj = tag.at(i); + std::string str ="Tag."+ std::to_string(i); + setCoreParameter(str + ".Value", obj.value); + setCoreParameter(str + ".Key", obj.key); + } +} + +std::vector TagResourcesRequest::getResourceId()const +{ + return resourceId_; +} + +void TagResourcesRequest::setResourceId(const std::vector& resourceId) +{ + resourceId_ = resourceId; + for(int i = 0; i!= resourceId.size(); i++) + setCoreParameter("ResourceId."+ std::to_string(i), resourceId.at(i)); +} + +std::string TagResourcesRequest::getResourceOwnerAccount()const +{ + return resourceOwnerAccount_; +} + +void TagResourcesRequest::setResourceOwnerAccount(const std::string& resourceOwnerAccount) +{ + resourceOwnerAccount_ = resourceOwnerAccount; + setCoreParameter("ResourceOwnerAccount", resourceOwnerAccount); +} + +std::string TagResourcesRequest::getOwnerAccount()const +{ + return ownerAccount_; +} + +void TagResourcesRequest::setOwnerAccount(const std::string& ownerAccount) +{ + ownerAccount_ = ownerAccount; + setCoreParameter("OwnerAccount", ownerAccount); +} + +long TagResourcesRequest::getOwnerId()const +{ + return ownerId_; +} + +void TagResourcesRequest::setOwnerId(long ownerId) +{ + ownerId_ = ownerId; + setCoreParameter("OwnerId", std::to_string(ownerId)); +} + +std::string TagResourcesRequest::getResourceType()const +{ + return resourceType_; +} + +void TagResourcesRequest::setResourceType(const std::string& resourceType) +{ + resourceType_ = resourceType; + setCoreParameter("ResourceType", resourceType); +} + diff --git a/adb/src/model/TagResourcesResult.cc b/adb/src/model/TagResourcesResult.cc new file mode 100644 index 000000000..256259393 --- /dev/null +++ b/adb/src/model/TagResourcesResult.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::Adb; +using namespace AlibabaCloud::Adb::Model; + +TagResourcesResult::TagResourcesResult() : + ServiceResult() +{} + +TagResourcesResult::TagResourcesResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +TagResourcesResult::~TagResourcesResult() +{} + +void TagResourcesResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + +} + diff --git a/adb/src/model/UntagResourcesRequest.cc b/adb/src/model/UntagResourcesRequest.cc new file mode 100644 index 000000000..2636224a1 --- /dev/null +++ b/adb/src/model/UntagResourcesRequest.cc @@ -0,0 +1,141 @@ +/* + * 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::Adb::Model::UntagResourcesRequest; + +UntagResourcesRequest::UntagResourcesRequest() : + RpcServiceRequest("adb", "2019-03-15", "UntagResources") +{ + setMethod(HttpRequest::Method::Post); +} + +UntagResourcesRequest::~UntagResourcesRequest() +{} + +long UntagResourcesRequest::getResourceOwnerId()const +{ + return resourceOwnerId_; +} + +void UntagResourcesRequest::setResourceOwnerId(long resourceOwnerId) +{ + resourceOwnerId_ = resourceOwnerId; + setCoreParameter("ResourceOwnerId", std::to_string(resourceOwnerId)); +} + +std::string UntagResourcesRequest::getAccessKeyId()const +{ + return accessKeyId_; +} + +void UntagResourcesRequest::setAccessKeyId(const std::string& accessKeyId) +{ + accessKeyId_ = accessKeyId; + setCoreParameter("AccessKeyId", accessKeyId); +} + +std::string UntagResourcesRequest::getRegionId()const +{ + return regionId_; +} + +void UntagResourcesRequest::setRegionId(const std::string& regionId) +{ + regionId_ = regionId; + setCoreParameter("RegionId", regionId); +} + +bool UntagResourcesRequest::getAll()const +{ + return all_; +} + +void UntagResourcesRequest::setAll(bool all) +{ + all_ = all; + setCoreParameter("All", all ? "true" : "false"); +} + +std::vector UntagResourcesRequest::getResourceId()const +{ + return resourceId_; +} + +void UntagResourcesRequest::setResourceId(const std::vector& resourceId) +{ + resourceId_ = resourceId; + for(int i = 0; i!= resourceId.size(); i++) + setCoreParameter("ResourceId."+ std::to_string(i), resourceId.at(i)); +} + +std::string UntagResourcesRequest::getResourceOwnerAccount()const +{ + return resourceOwnerAccount_; +} + +void UntagResourcesRequest::setResourceOwnerAccount(const std::string& resourceOwnerAccount) +{ + resourceOwnerAccount_ = resourceOwnerAccount; + setCoreParameter("ResourceOwnerAccount", resourceOwnerAccount); +} + +std::string UntagResourcesRequest::getOwnerAccount()const +{ + return ownerAccount_; +} + +void UntagResourcesRequest::setOwnerAccount(const std::string& ownerAccount) +{ + ownerAccount_ = ownerAccount; + setCoreParameter("OwnerAccount", ownerAccount); +} + +long UntagResourcesRequest::getOwnerId()const +{ + return ownerId_; +} + +void UntagResourcesRequest::setOwnerId(long ownerId) +{ + ownerId_ = ownerId; + setCoreParameter("OwnerId", std::to_string(ownerId)); +} + +std::string UntagResourcesRequest::getResourceType()const +{ + return resourceType_; +} + +void UntagResourcesRequest::setResourceType(const std::string& resourceType) +{ + resourceType_ = resourceType; + setCoreParameter("ResourceType", resourceType); +} + +std::vector UntagResourcesRequest::getTagKey()const +{ + return tagKey_; +} + +void UntagResourcesRequest::setTagKey(const std::vector& tagKey) +{ + tagKey_ = tagKey; + for(int i = 0; i!= tagKey.size(); i++) + setCoreParameter("TagKey."+ std::to_string(i), tagKey.at(i)); +} + diff --git a/adb/src/model/UntagResourcesResult.cc b/adb/src/model/UntagResourcesResult.cc new file mode 100644 index 000000000..cea5ecd06 --- /dev/null +++ b/adb/src/model/UntagResourcesResult.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::Adb; +using namespace AlibabaCloud::Adb::Model; + +UntagResourcesResult::UntagResourcesResult() : + ServiceResult() +{} + +UntagResourcesResult::UntagResourcesResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +UntagResourcesResult::~UntagResourcesResult() +{} + +void UntagResourcesResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + +} +