From 243879b17f2135235b16faa2766ebf610344ef16 Mon Sep 17 00:00:00 2001 From: sdk-team Date: Tue, 23 Jun 2020 16:23:57 +0800 Subject: [PATCH] Generated 2018-08-28 for Tag. --- CHANGELOG | 3 + VERSION | 2 +- tag/CMakeLists.txt | 8 ++ tag/include/alibabacloud/tag/TagClient.h | 16 +++ .../tag/model/ListTagKeysRequest.h | 69 +++++++++++ .../tag/model/ListTagKeysResult.h | 58 +++++++++ .../tag/model/ListTagResourcesRequest.h | 3 - .../tag/model/ListTagValuesRequest.h | 69 +++++++++++ .../tag/model/ListTagValuesResult.h | 53 ++++++++ .../tag/model/TagResourcesRequest.h | 3 - .../tag/model/UntagResourcesRequest.h | 3 - tag/src/TagClient.cc | 72 +++++++++++ tag/src/model/ListTagKeysRequest.cc | 117 ++++++++++++++++++ tag/src/model/ListTagKeysResult.cc | 66 ++++++++++ tag/src/model/ListTagResourcesRequest.cc | 11 -- tag/src/model/ListTagValuesRequest.cc | 117 ++++++++++++++++++ tag/src/model/ListTagValuesResult.cc | 59 +++++++++ tag/src/model/TagResourcesRequest.cc | 11 -- tag/src/model/UntagResourcesRequest.cc | 11 -- 19 files changed, 708 insertions(+), 43 deletions(-) create mode 100644 tag/include/alibabacloud/tag/model/ListTagKeysRequest.h create mode 100644 tag/include/alibabacloud/tag/model/ListTagKeysResult.h create mode 100644 tag/include/alibabacloud/tag/model/ListTagValuesRequest.h create mode 100644 tag/include/alibabacloud/tag/model/ListTagValuesResult.h create mode 100644 tag/src/model/ListTagKeysRequest.cc create mode 100644 tag/src/model/ListTagKeysResult.cc create mode 100644 tag/src/model/ListTagValuesRequest.cc create mode 100644 tag/src/model/ListTagValuesResult.cc diff --git a/CHANGELOG b/CHANGELOG index a7880e257..70cafb3f6 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2020-06-23 Version: 1.36.475 +- Generated 2018-08-28 for `Tag`. + 2020-06-23 Version: 1.36.474 - Public beta version. - Add Api Overseas. diff --git a/VERSION b/VERSION index 46d70288a..3b78db538 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.474 \ No newline at end of file +1.36.475 \ No newline at end of file diff --git a/tag/CMakeLists.txt b/tag/CMakeLists.txt index c5c1c419e..d7aaf4d0f 100644 --- a/tag/CMakeLists.txt +++ b/tag/CMakeLists.txt @@ -21,8 +21,12 @@ set(tag_public_header include/alibabacloud/tag/TagExport.h ) set(tag_public_header_model + include/alibabacloud/tag/model/ListTagKeysRequest.h + include/alibabacloud/tag/model/ListTagKeysResult.h include/alibabacloud/tag/model/ListTagResourcesRequest.h include/alibabacloud/tag/model/ListTagResourcesResult.h + include/alibabacloud/tag/model/ListTagValuesRequest.h + include/alibabacloud/tag/model/ListTagValuesResult.h include/alibabacloud/tag/model/TagResourcesRequest.h include/alibabacloud/tag/model/TagResourcesResult.h include/alibabacloud/tag/model/UntagResourcesRequest.h @@ -30,8 +34,12 @@ set(tag_public_header_model set(tag_src src/TagClient.cc + src/model/ListTagKeysRequest.cc + src/model/ListTagKeysResult.cc src/model/ListTagResourcesRequest.cc src/model/ListTagResourcesResult.cc + src/model/ListTagValuesRequest.cc + src/model/ListTagValuesResult.cc src/model/TagResourcesRequest.cc src/model/TagResourcesResult.cc src/model/UntagResourcesRequest.cc diff --git a/tag/include/alibabacloud/tag/TagClient.h b/tag/include/alibabacloud/tag/TagClient.h index 4425556cf..508a94efa 100644 --- a/tag/include/alibabacloud/tag/TagClient.h +++ b/tag/include/alibabacloud/tag/TagClient.h @@ -22,8 +22,12 @@ #include #include #include "TagExport.h" +#include "model/ListTagKeysRequest.h" +#include "model/ListTagKeysResult.h" #include "model/ListTagResourcesRequest.h" #include "model/ListTagResourcesResult.h" +#include "model/ListTagValuesRequest.h" +#include "model/ListTagValuesResult.h" #include "model/TagResourcesRequest.h" #include "model/TagResourcesResult.h" #include "model/UntagResourcesRequest.h" @@ -37,9 +41,15 @@ namespace AlibabaCloud class ALIBABACLOUD_TAG_EXPORT TagClient : public RpcServiceClient { public: + typedef Outcome ListTagKeysOutcome; + typedef std::future ListTagKeysOutcomeCallable; + typedef std::function&)> ListTagKeysAsyncHandler; typedef Outcome ListTagResourcesOutcome; typedef std::future ListTagResourcesOutcomeCallable; typedef std::function&)> ListTagResourcesAsyncHandler; + typedef Outcome ListTagValuesOutcome; + typedef std::future ListTagValuesOutcomeCallable; + typedef std::function&)> ListTagValuesAsyncHandler; typedef Outcome TagResourcesOutcome; typedef std::future TagResourcesOutcomeCallable; typedef std::function&)> TagResourcesAsyncHandler; @@ -51,9 +61,15 @@ namespace AlibabaCloud TagClient(const std::shared_ptr &credentialsProvider, const ClientConfiguration &configuration); TagClient(const std::string &accessKeyId, const std::string &accessKeySecret, const ClientConfiguration &configuration); ~TagClient(); + ListTagKeysOutcome listTagKeys(const Model::ListTagKeysRequest &request)const; + void listTagKeysAsync(const Model::ListTagKeysRequest& request, const ListTagKeysAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + ListTagKeysOutcomeCallable listTagKeysCallable(const Model::ListTagKeysRequest& 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; + ListTagValuesOutcome listTagValues(const Model::ListTagValuesRequest &request)const; + void listTagValuesAsync(const Model::ListTagValuesRequest& request, const ListTagValuesAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + ListTagValuesOutcomeCallable listTagValuesCallable(const Model::ListTagValuesRequest& 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; diff --git a/tag/include/alibabacloud/tag/model/ListTagKeysRequest.h b/tag/include/alibabacloud/tag/model/ListTagKeysRequest.h new file mode 100644 index 000000000..857315442 --- /dev/null +++ b/tag/include/alibabacloud/tag/model/ListTagKeysRequest.h @@ -0,0 +1,69 @@ +/* + * 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_TAG_MODEL_LISTTAGKEYSREQUEST_H_ +#define ALIBABACLOUD_TAG_MODEL_LISTTAGKEYSREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Tag + { + namespace Model + { + class ALIBABACLOUD_TAG_EXPORT ListTagKeysRequest : public RpcServiceRequest + { + + public: + ListTagKeysRequest(); + ~ListTagKeysRequest(); + + std::string getRegionId()const; + void setRegionId(const std::string& regionId); + std::string getNextToken()const; + void setNextToken(const std::string& nextToken); + int getPageSize()const; + void setPageSize(int pageSize); + 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::string getCategory()const; + void setCategory(const std::string& category); + + private: + std::string regionId_; + std::string nextToken_; + int pageSize_; + std::string resourceOwnerAccount_; + std::string ownerAccount_; + long ownerId_; + std::string resourceType_; + std::string category_; + + }; + } + } +} +#endif // !ALIBABACLOUD_TAG_MODEL_LISTTAGKEYSREQUEST_H_ \ No newline at end of file diff --git a/tag/include/alibabacloud/tag/model/ListTagKeysResult.h b/tag/include/alibabacloud/tag/model/ListTagKeysResult.h new file mode 100644 index 000000000..a8a8179e2 --- /dev/null +++ b/tag/include/alibabacloud/tag/model/ListTagKeysResult.h @@ -0,0 +1,58 @@ +/* + * 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_TAG_MODEL_LISTTAGKEYSRESULT_H_ +#define ALIBABACLOUD_TAG_MODEL_LISTTAGKEYSRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Tag + { + namespace Model + { + class ALIBABACLOUD_TAG_EXPORT ListTagKeysResult : public ServiceResult + { + public: + struct Key + { + std::string category; + std::string key; + }; + + + ListTagKeysResult(); + explicit ListTagKeysResult(const std::string &payload); + ~ListTagKeysResult(); + std::string getNextToken()const; + std::vector getKeys()const; + + protected: + void parse(const std::string &payload); + private: + std::string nextToken_; + std::vector keys_; + + }; + } + } +} +#endif // !ALIBABACLOUD_TAG_MODEL_LISTTAGKEYSRESULT_H_ \ No newline at end of file diff --git a/tag/include/alibabacloud/tag/model/ListTagResourcesRequest.h b/tag/include/alibabacloud/tag/model/ListTagResourcesRequest.h index 73db07a57..4edc0ba9b 100644 --- a/tag/include/alibabacloud/tag/model/ListTagResourcesRequest.h +++ b/tag/include/alibabacloud/tag/model/ListTagResourcesRequest.h @@ -35,8 +35,6 @@ namespace AlibabaCloud ListTagResourcesRequest(); ~ListTagResourcesRequest(); - long getResourceOwnerId()const; - void setResourceOwnerId(long resourceOwnerId); std::string getRegionId()const; void setRegionId(const std::string& regionId); std::string getNextToken()const; @@ -57,7 +55,6 @@ namespace AlibabaCloud void setCategory(const std::string& category); private: - long resourceOwnerId_; std::string regionId_; std::string nextToken_; int pageSize_; diff --git a/tag/include/alibabacloud/tag/model/ListTagValuesRequest.h b/tag/include/alibabacloud/tag/model/ListTagValuesRequest.h new file mode 100644 index 000000000..c5357fd76 --- /dev/null +++ b/tag/include/alibabacloud/tag/model/ListTagValuesRequest.h @@ -0,0 +1,69 @@ +/* + * 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_TAG_MODEL_LISTTAGVALUESREQUEST_H_ +#define ALIBABACLOUD_TAG_MODEL_LISTTAGVALUESREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Tag + { + namespace Model + { + class ALIBABACLOUD_TAG_EXPORT ListTagValuesRequest : public RpcServiceRequest + { + + public: + ListTagValuesRequest(); + ~ListTagValuesRequest(); + + std::string getRegionId()const; + void setRegionId(const std::string& regionId); + std::string getNextToken()const; + void setNextToken(const std::string& nextToken); + int getPageSize()const; + void setPageSize(int pageSize); + std::string getKey()const; + void setKey(const std::string& key); + 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: + std::string regionId_; + std::string nextToken_; + int pageSize_; + std::string key_; + std::string resourceOwnerAccount_; + std::string ownerAccount_; + long ownerId_; + std::string resourceType_; + + }; + } + } +} +#endif // !ALIBABACLOUD_TAG_MODEL_LISTTAGVALUESREQUEST_H_ \ No newline at end of file diff --git a/tag/include/alibabacloud/tag/model/ListTagValuesResult.h b/tag/include/alibabacloud/tag/model/ListTagValuesResult.h new file mode 100644 index 000000000..398f7bf29 --- /dev/null +++ b/tag/include/alibabacloud/tag/model/ListTagValuesResult.h @@ -0,0 +1,53 @@ +/* + * 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_TAG_MODEL_LISTTAGVALUESRESULT_H_ +#define ALIBABACLOUD_TAG_MODEL_LISTTAGVALUESRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Tag + { + namespace Model + { + class ALIBABACLOUD_TAG_EXPORT ListTagValuesResult : public ServiceResult + { + public: + + + ListTagValuesResult(); + explicit ListTagValuesResult(const std::string &payload); + ~ListTagValuesResult(); + std::string getNextToken()const; + std::vector getValues()const; + + protected: + void parse(const std::string &payload); + private: + std::string nextToken_; + std::vector values_; + + }; + } + } +} +#endif // !ALIBABACLOUD_TAG_MODEL_LISTTAGVALUESRESULT_H_ \ No newline at end of file diff --git a/tag/include/alibabacloud/tag/model/TagResourcesRequest.h b/tag/include/alibabacloud/tag/model/TagResourcesRequest.h index 21ac80c4e..c32ca4995 100644 --- a/tag/include/alibabacloud/tag/model/TagResourcesRequest.h +++ b/tag/include/alibabacloud/tag/model/TagResourcesRequest.h @@ -35,8 +35,6 @@ namespace AlibabaCloud TagResourcesRequest(); ~TagResourcesRequest(); - long getResourceOwnerId()const; - void setResourceOwnerId(long resourceOwnerId); std::string getRegionId()const; void setRegionId(const std::string& regionId); std::vector getResourceARN()const; @@ -51,7 +49,6 @@ namespace AlibabaCloud void setTags(const std::string& tags); private: - long resourceOwnerId_; std::string regionId_; std::vector resourceARN_; std::string resourceOwnerAccount_; diff --git a/tag/include/alibabacloud/tag/model/UntagResourcesRequest.h b/tag/include/alibabacloud/tag/model/UntagResourcesRequest.h index 8989fde4d..ae231f33d 100644 --- a/tag/include/alibabacloud/tag/model/UntagResourcesRequest.h +++ b/tag/include/alibabacloud/tag/model/UntagResourcesRequest.h @@ -35,8 +35,6 @@ namespace AlibabaCloud UntagResourcesRequest(); ~UntagResourcesRequest(); - long getResourceOwnerId()const; - void setResourceOwnerId(long resourceOwnerId); std::string getRegionId()const; void setRegionId(const std::string& regionId); std::vector getResourceARN()const; @@ -51,7 +49,6 @@ namespace AlibabaCloud void setTagKey(const std::vector& tagKey); private: - long resourceOwnerId_; std::string regionId_; std::vector resourceARN_; std::string resourceOwnerAccount_; diff --git a/tag/src/TagClient.cc b/tag/src/TagClient.cc index e0a79ae5b..f8678c576 100644 --- a/tag/src/TagClient.cc +++ b/tag/src/TagClient.cc @@ -51,6 +51,42 @@ TagClient::TagClient(const std::string & accessKeyId, const std::string & access TagClient::~TagClient() {} +TagClient::ListTagKeysOutcome TagClient::listTagKeys(const ListTagKeysRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return ListTagKeysOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return ListTagKeysOutcome(ListTagKeysResult(outcome.result())); + else + return ListTagKeysOutcome(outcome.error()); +} + +void TagClient::listTagKeysAsync(const ListTagKeysRequest& request, const ListTagKeysAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, listTagKeys(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +TagClient::ListTagKeysOutcomeCallable TagClient::listTagKeysCallable(const ListTagKeysRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->listTagKeys(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + TagClient::ListTagResourcesOutcome TagClient::listTagResources(const ListTagResourcesRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); @@ -87,6 +123,42 @@ TagClient::ListTagResourcesOutcomeCallable TagClient::listTagResourcesCallable(c return task->get_future(); } +TagClient::ListTagValuesOutcome TagClient::listTagValues(const ListTagValuesRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return ListTagValuesOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return ListTagValuesOutcome(ListTagValuesResult(outcome.result())); + else + return ListTagValuesOutcome(outcome.error()); +} + +void TagClient::listTagValuesAsync(const ListTagValuesRequest& request, const ListTagValuesAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, listTagValues(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +TagClient::ListTagValuesOutcomeCallable TagClient::listTagValuesCallable(const ListTagValuesRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->listTagValues(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + TagClient::TagResourcesOutcome TagClient::tagResources(const TagResourcesRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); diff --git a/tag/src/model/ListTagKeysRequest.cc b/tag/src/model/ListTagKeysRequest.cc new file mode 100644 index 000000000..d7f0ee80b --- /dev/null +++ b/tag/src/model/ListTagKeysRequest.cc @@ -0,0 +1,117 @@ +/* + * 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::Tag::Model::ListTagKeysRequest; + +ListTagKeysRequest::ListTagKeysRequest() : + RpcServiceRequest("tag", "2018-08-28", "ListTagKeys") +{ + setMethod(HttpRequest::Method::Post); +} + +ListTagKeysRequest::~ListTagKeysRequest() +{} + +std::string ListTagKeysRequest::getRegionId()const +{ + return regionId_; +} + +void ListTagKeysRequest::setRegionId(const std::string& regionId) +{ + regionId_ = regionId; + setParameter("RegionId", regionId); +} + +std::string ListTagKeysRequest::getNextToken()const +{ + return nextToken_; +} + +void ListTagKeysRequest::setNextToken(const std::string& nextToken) +{ + nextToken_ = nextToken; + setParameter("NextToken", nextToken); +} + +int ListTagKeysRequest::getPageSize()const +{ + return pageSize_; +} + +void ListTagKeysRequest::setPageSize(int pageSize) +{ + pageSize_ = pageSize; + setParameter("PageSize", std::to_string(pageSize)); +} + +std::string ListTagKeysRequest::getResourceOwnerAccount()const +{ + return resourceOwnerAccount_; +} + +void ListTagKeysRequest::setResourceOwnerAccount(const std::string& resourceOwnerAccount) +{ + resourceOwnerAccount_ = resourceOwnerAccount; + setParameter("ResourceOwnerAccount", resourceOwnerAccount); +} + +std::string ListTagKeysRequest::getOwnerAccount()const +{ + return ownerAccount_; +} + +void ListTagKeysRequest::setOwnerAccount(const std::string& ownerAccount) +{ + ownerAccount_ = ownerAccount; + setParameter("OwnerAccount", ownerAccount); +} + +long ListTagKeysRequest::getOwnerId()const +{ + return ownerId_; +} + +void ListTagKeysRequest::setOwnerId(long ownerId) +{ + ownerId_ = ownerId; + setParameter("OwnerId", std::to_string(ownerId)); +} + +std::string ListTagKeysRequest::getResourceType()const +{ + return resourceType_; +} + +void ListTagKeysRequest::setResourceType(const std::string& resourceType) +{ + resourceType_ = resourceType; + setParameter("ResourceType", resourceType); +} + +std::string ListTagKeysRequest::getCategory()const +{ + return category_; +} + +void ListTagKeysRequest::setCategory(const std::string& category) +{ + category_ = category; + setParameter("Category", category); +} + diff --git a/tag/src/model/ListTagKeysResult.cc b/tag/src/model/ListTagKeysResult.cc new file mode 100644 index 000000000..6130b0568 --- /dev/null +++ b/tag/src/model/ListTagKeysResult.cc @@ -0,0 +1,66 @@ +/* + * 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::Tag; +using namespace AlibabaCloud::Tag::Model; + +ListTagKeysResult::ListTagKeysResult() : + ServiceResult() +{} + +ListTagKeysResult::ListTagKeysResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +ListTagKeysResult::~ListTagKeysResult() +{} + +void ListTagKeysResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto allKeysNode = value["Keys"]["Key"]; + for (auto valueKeysKey : allKeysNode) + { + Key keysObject; + if(!valueKeysKey["Category"].isNull()) + keysObject.category = valueKeysKey["Category"].asString(); + if(!valueKeysKey["Key"].isNull()) + keysObject.key = valueKeysKey["Key"].asString(); + keys_.push_back(keysObject); + } + if(!value["NextToken"].isNull()) + nextToken_ = value["NextToken"].asString(); + +} + +std::string ListTagKeysResult::getNextToken()const +{ + return nextToken_; +} + +std::vector ListTagKeysResult::getKeys()const +{ + return keys_; +} + diff --git a/tag/src/model/ListTagResourcesRequest.cc b/tag/src/model/ListTagResourcesRequest.cc index 4ff2a531d..3240d4670 100644 --- a/tag/src/model/ListTagResourcesRequest.cc +++ b/tag/src/model/ListTagResourcesRequest.cc @@ -27,17 +27,6 @@ ListTagResourcesRequest::ListTagResourcesRequest() : ListTagResourcesRequest::~ListTagResourcesRequest() {} -long ListTagResourcesRequest::getResourceOwnerId()const -{ - return resourceOwnerId_; -} - -void ListTagResourcesRequest::setResourceOwnerId(long resourceOwnerId) -{ - resourceOwnerId_ = resourceOwnerId; - setParameter("ResourceOwnerId", std::to_string(resourceOwnerId)); -} - std::string ListTagResourcesRequest::getRegionId()const { return regionId_; diff --git a/tag/src/model/ListTagValuesRequest.cc b/tag/src/model/ListTagValuesRequest.cc new file mode 100644 index 000000000..6a2a35d6c --- /dev/null +++ b/tag/src/model/ListTagValuesRequest.cc @@ -0,0 +1,117 @@ +/* + * 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::Tag::Model::ListTagValuesRequest; + +ListTagValuesRequest::ListTagValuesRequest() : + RpcServiceRequest("tag", "2018-08-28", "ListTagValues") +{ + setMethod(HttpRequest::Method::Post); +} + +ListTagValuesRequest::~ListTagValuesRequest() +{} + +std::string ListTagValuesRequest::getRegionId()const +{ + return regionId_; +} + +void ListTagValuesRequest::setRegionId(const std::string& regionId) +{ + regionId_ = regionId; + setParameter("RegionId", regionId); +} + +std::string ListTagValuesRequest::getNextToken()const +{ + return nextToken_; +} + +void ListTagValuesRequest::setNextToken(const std::string& nextToken) +{ + nextToken_ = nextToken; + setParameter("NextToken", nextToken); +} + +int ListTagValuesRequest::getPageSize()const +{ + return pageSize_; +} + +void ListTagValuesRequest::setPageSize(int pageSize) +{ + pageSize_ = pageSize; + setParameter("PageSize", std::to_string(pageSize)); +} + +std::string ListTagValuesRequest::getKey()const +{ + return key_; +} + +void ListTagValuesRequest::setKey(const std::string& key) +{ + key_ = key; + setParameter("Key", key); +} + +std::string ListTagValuesRequest::getResourceOwnerAccount()const +{ + return resourceOwnerAccount_; +} + +void ListTagValuesRequest::setResourceOwnerAccount(const std::string& resourceOwnerAccount) +{ + resourceOwnerAccount_ = resourceOwnerAccount; + setParameter("ResourceOwnerAccount", resourceOwnerAccount); +} + +std::string ListTagValuesRequest::getOwnerAccount()const +{ + return ownerAccount_; +} + +void ListTagValuesRequest::setOwnerAccount(const std::string& ownerAccount) +{ + ownerAccount_ = ownerAccount; + setParameter("OwnerAccount", ownerAccount); +} + +long ListTagValuesRequest::getOwnerId()const +{ + return ownerId_; +} + +void ListTagValuesRequest::setOwnerId(long ownerId) +{ + ownerId_ = ownerId; + setParameter("OwnerId", std::to_string(ownerId)); +} + +std::string ListTagValuesRequest::getResourceType()const +{ + return resourceType_; +} + +void ListTagValuesRequest::setResourceType(const std::string& resourceType) +{ + resourceType_ = resourceType; + setParameter("ResourceType", resourceType); +} + diff --git a/tag/src/model/ListTagValuesResult.cc b/tag/src/model/ListTagValuesResult.cc new file mode 100644 index 000000000..b0187c854 --- /dev/null +++ b/tag/src/model/ListTagValuesResult.cc @@ -0,0 +1,59 @@ +/* + * 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::Tag; +using namespace AlibabaCloud::Tag::Model; + +ListTagValuesResult::ListTagValuesResult() : + ServiceResult() +{} + +ListTagValuesResult::ListTagValuesResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +ListTagValuesResult::~ListTagValuesResult() +{} + +void ListTagValuesResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto allValues = value["Values"]["Value"]; + for (const auto &item : allValues) + values_.push_back(item.asString()); + if(!value["NextToken"].isNull()) + nextToken_ = value["NextToken"].asString(); + +} + +std::string ListTagValuesResult::getNextToken()const +{ + return nextToken_; +} + +std::vector ListTagValuesResult::getValues()const +{ + return values_; +} + diff --git a/tag/src/model/TagResourcesRequest.cc b/tag/src/model/TagResourcesRequest.cc index a6e722d92..ef26cc498 100644 --- a/tag/src/model/TagResourcesRequest.cc +++ b/tag/src/model/TagResourcesRequest.cc @@ -27,17 +27,6 @@ TagResourcesRequest::TagResourcesRequest() : TagResourcesRequest::~TagResourcesRequest() {} -long TagResourcesRequest::getResourceOwnerId()const -{ - return resourceOwnerId_; -} - -void TagResourcesRequest::setResourceOwnerId(long resourceOwnerId) -{ - resourceOwnerId_ = resourceOwnerId; - setParameter("ResourceOwnerId", std::to_string(resourceOwnerId)); -} - std::string TagResourcesRequest::getRegionId()const { return regionId_; diff --git a/tag/src/model/UntagResourcesRequest.cc b/tag/src/model/UntagResourcesRequest.cc index 73bff497e..042e1c3c9 100644 --- a/tag/src/model/UntagResourcesRequest.cc +++ b/tag/src/model/UntagResourcesRequest.cc @@ -27,17 +27,6 @@ UntagResourcesRequest::UntagResourcesRequest() : UntagResourcesRequest::~UntagResourcesRequest() {} -long UntagResourcesRequest::getResourceOwnerId()const -{ - return resourceOwnerId_; -} - -void UntagResourcesRequest::setResourceOwnerId(long resourceOwnerId) -{ - resourceOwnerId_ = resourceOwnerId; - setParameter("ResourceOwnerId", std::to_string(resourceOwnerId)); -} - std::string UntagResourcesRequest::getRegionId()const { return regionId_;