diff --git a/CHANGELOG b/CHANGELOG index 59c22075b..e1b764e1d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2020-07-01 Version: 1.36.489 +- Add API for GetMetadataAmount. + 2020-07-01 Version: 1.36.488 - Support Saf For ExecuteExtendService. diff --git a/VERSION b/VERSION index 066181532..ed78099ec 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.488 \ No newline at end of file +1.36.489 \ No newline at end of file diff --git a/amqp-open/CMakeLists.txt b/amqp-open/CMakeLists.txt index 23b5ea3fd..d51009605 100644 --- a/amqp-open/CMakeLists.txt +++ b/amqp-open/CMakeLists.txt @@ -37,6 +37,8 @@ set(amqp-open_public_header_model include/alibabacloud/amqp-open/model/DeleteQueueResult.h include/alibabacloud/amqp-open/model/DeleteVirtualHostRequest.h include/alibabacloud/amqp-open/model/DeleteVirtualHostResult.h + include/alibabacloud/amqp-open/model/GetMetadataAmountRequest.h + include/alibabacloud/amqp-open/model/GetMetadataAmountResult.h include/alibabacloud/amqp-open/model/ListBindingsRequest.h include/alibabacloud/amqp-open/model/ListBindingsResult.h include/alibabacloud/amqp-open/model/ListDownStreamBindingsRequest.h @@ -47,6 +49,8 @@ set(amqp-open_public_header_model include/alibabacloud/amqp-open/model/ListExchangesResult.h include/alibabacloud/amqp-open/model/ListInstancesRequest.h include/alibabacloud/amqp-open/model/ListInstancesResult.h + include/alibabacloud/amqp-open/model/ListQueueConsumersRequest.h + include/alibabacloud/amqp-open/model/ListQueueConsumersResult.h include/alibabacloud/amqp-open/model/ListQueueUpStreamBindingsRequest.h include/alibabacloud/amqp-open/model/ListQueueUpStreamBindingsResult.h include/alibabacloud/amqp-open/model/ListQueuesRequest.h @@ -72,6 +76,8 @@ set(amqp-open_src src/model/DeleteQueueResult.cc src/model/DeleteVirtualHostRequest.cc src/model/DeleteVirtualHostResult.cc + src/model/GetMetadataAmountRequest.cc + src/model/GetMetadataAmountResult.cc src/model/ListBindingsRequest.cc src/model/ListBindingsResult.cc src/model/ListDownStreamBindingsRequest.cc @@ -82,6 +88,8 @@ set(amqp-open_src src/model/ListExchangesResult.cc src/model/ListInstancesRequest.cc src/model/ListInstancesResult.cc + src/model/ListQueueConsumersRequest.cc + src/model/ListQueueConsumersResult.cc src/model/ListQueueUpStreamBindingsRequest.cc src/model/ListQueueUpStreamBindingsResult.cc src/model/ListQueuesRequest.cc diff --git a/amqp-open/include/alibabacloud/amqp-open/Amqp_openClient.h b/amqp-open/include/alibabacloud/amqp-open/Amqp_openClient.h index f9ef87532..c40d49917 100644 --- a/amqp-open/include/alibabacloud/amqp-open/Amqp_openClient.h +++ b/amqp-open/include/alibabacloud/amqp-open/Amqp_openClient.h @@ -38,6 +38,8 @@ #include "model/DeleteQueueResult.h" #include "model/DeleteVirtualHostRequest.h" #include "model/DeleteVirtualHostResult.h" +#include "model/GetMetadataAmountRequest.h" +#include "model/GetMetadataAmountResult.h" #include "model/ListBindingsRequest.h" #include "model/ListBindingsResult.h" #include "model/ListDownStreamBindingsRequest.h" @@ -48,6 +50,8 @@ #include "model/ListExchangesResult.h" #include "model/ListInstancesRequest.h" #include "model/ListInstancesResult.h" +#include "model/ListQueueConsumersRequest.h" +#include "model/ListQueueConsumersResult.h" #include "model/ListQueueUpStreamBindingsRequest.h" #include "model/ListQueueUpStreamBindingsResult.h" #include "model/ListQueuesRequest.h" @@ -87,6 +91,9 @@ namespace AlibabaCloud typedef Outcome DeleteVirtualHostOutcome; typedef std::future DeleteVirtualHostOutcomeCallable; typedef std::function&)> DeleteVirtualHostAsyncHandler; + typedef Outcome GetMetadataAmountOutcome; + typedef std::future GetMetadataAmountOutcomeCallable; + typedef std::function&)> GetMetadataAmountAsyncHandler; typedef Outcome ListBindingsOutcome; typedef std::future ListBindingsOutcomeCallable; typedef std::function&)> ListBindingsAsyncHandler; @@ -102,6 +109,9 @@ namespace AlibabaCloud typedef Outcome ListInstancesOutcome; typedef std::future ListInstancesOutcomeCallable; typedef std::function&)> ListInstancesAsyncHandler; + typedef Outcome ListQueueConsumersOutcome; + typedef std::future ListQueueConsumersOutcomeCallable; + typedef std::function&)> ListQueueConsumersAsyncHandler; typedef Outcome ListQueueUpStreamBindingsOutcome; typedef std::future ListQueueUpStreamBindingsOutcomeCallable; typedef std::function&)> ListQueueUpStreamBindingsAsyncHandler; @@ -140,6 +150,9 @@ namespace AlibabaCloud DeleteVirtualHostOutcome deleteVirtualHost(const Model::DeleteVirtualHostRequest &request)const; void deleteVirtualHostAsync(const Model::DeleteVirtualHostRequest& request, const DeleteVirtualHostAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; DeleteVirtualHostOutcomeCallable deleteVirtualHostCallable(const Model::DeleteVirtualHostRequest& request) const; + GetMetadataAmountOutcome getMetadataAmount(const Model::GetMetadataAmountRequest &request)const; + void getMetadataAmountAsync(const Model::GetMetadataAmountRequest& request, const GetMetadataAmountAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + GetMetadataAmountOutcomeCallable getMetadataAmountCallable(const Model::GetMetadataAmountRequest& request) const; ListBindingsOutcome listBindings(const Model::ListBindingsRequest &request)const; void listBindingsAsync(const Model::ListBindingsRequest& request, const ListBindingsAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; ListBindingsOutcomeCallable listBindingsCallable(const Model::ListBindingsRequest& request) const; @@ -155,6 +168,9 @@ namespace AlibabaCloud ListInstancesOutcome listInstances(const Model::ListInstancesRequest &request)const; void listInstancesAsync(const Model::ListInstancesRequest& request, const ListInstancesAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; ListInstancesOutcomeCallable listInstancesCallable(const Model::ListInstancesRequest& request) const; + ListQueueConsumersOutcome listQueueConsumers(const Model::ListQueueConsumersRequest &request)const; + void listQueueConsumersAsync(const Model::ListQueueConsumersRequest& request, const ListQueueConsumersAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + ListQueueConsumersOutcomeCallable listQueueConsumersCallable(const Model::ListQueueConsumersRequest& request) const; ListQueueUpStreamBindingsOutcome listQueueUpStreamBindings(const Model::ListQueueUpStreamBindingsRequest &request)const; void listQueueUpStreamBindingsAsync(const Model::ListQueueUpStreamBindingsRequest& request, const ListQueueUpStreamBindingsAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; ListQueueUpStreamBindingsOutcomeCallable listQueueUpStreamBindingsCallable(const Model::ListQueueUpStreamBindingsRequest& request) const; diff --git a/amqp-open/include/alibabacloud/amqp-open/model/GetMetadataAmountRequest.h b/amqp-open/include/alibabacloud/amqp-open/model/GetMetadataAmountRequest.h new file mode 100644 index 000000000..81a139c6d --- /dev/null +++ b/amqp-open/include/alibabacloud/amqp-open/model/GetMetadataAmountRequest.h @@ -0,0 +1,48 @@ +/* + * 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_AMQP_OPEN_MODEL_GETMETADATAAMOUNTREQUEST_H_ +#define ALIBABACLOUD_AMQP_OPEN_MODEL_GETMETADATAAMOUNTREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Amqp_open + { + namespace Model + { + class ALIBABACLOUD_AMQP_OPEN_EXPORT GetMetadataAmountRequest : public RpcServiceRequest + { + + public: + GetMetadataAmountRequest(); + ~GetMetadataAmountRequest(); + + std::string getInstanceId()const; + void setInstanceId(const std::string& instanceId); + + private: + std::string instanceId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_AMQP_OPEN_MODEL_GETMETADATAAMOUNTREQUEST_H_ \ No newline at end of file diff --git a/amqp-open/include/alibabacloud/amqp-open/model/GetMetadataAmountResult.h b/amqp-open/include/alibabacloud/amqp-open/model/GetMetadataAmountResult.h new file mode 100644 index 000000000..6954c9d08 --- /dev/null +++ b/amqp-open/include/alibabacloud/amqp-open/model/GetMetadataAmountResult.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_AMQP_OPEN_MODEL_GETMETADATAAMOUNTRESULT_H_ +#define ALIBABACLOUD_AMQP_OPEN_MODEL_GETMETADATAAMOUNTRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Amqp_open + { + namespace Model + { + class ALIBABACLOUD_AMQP_OPEN_EXPORT GetMetadataAmountResult : public ServiceResult + { + public: + struct Data + { + int maxExchanges; + int maxVirtualHosts; + int currentExchanges; + int maxQueues; + int currentVirtualHosts; + int currentQueues; + }; + + + GetMetadataAmountResult(); + explicit GetMetadataAmountResult(const std::string &payload); + ~GetMetadataAmountResult(); + Data getData()const; + + protected: + void parse(const std::string &payload); + private: + Data data_; + + }; + } + } +} +#endif // !ALIBABACLOUD_AMQP_OPEN_MODEL_GETMETADATAAMOUNTRESULT_H_ \ No newline at end of file diff --git a/amqp-open/include/alibabacloud/amqp-open/model/ListQueueConsumersRequest.h b/amqp-open/include/alibabacloud/amqp-open/model/ListQueueConsumersRequest.h new file mode 100644 index 000000000..28a019843 --- /dev/null +++ b/amqp-open/include/alibabacloud/amqp-open/model/ListQueueConsumersRequest.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_AMQP_OPEN_MODEL_LISTQUEUECONSUMERSREQUEST_H_ +#define ALIBABACLOUD_AMQP_OPEN_MODEL_LISTQUEUECONSUMERSREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Amqp_open + { + namespace Model + { + class ALIBABACLOUD_AMQP_OPEN_EXPORT ListQueueConsumersRequest : public RpcServiceRequest + { + + public: + ListQueueConsumersRequest(); + ~ListQueueConsumersRequest(); + + std::string getInstanceId()const; + void setInstanceId(const std::string& instanceId); + std::string getNextToken()const; + void setNextToken(const std::string& nextToken); + int getQueryCount()const; + void setQueryCount(int queryCount); + std::string getVirtualHost()const; + void setVirtualHost(const std::string& virtualHost); + std::string getQueue()const; + void setQueue(const std::string& queue); + + private: + std::string instanceId_; + std::string nextToken_; + int queryCount_; + std::string virtualHost_; + std::string queue_; + + }; + } + } +} +#endif // !ALIBABACLOUD_AMQP_OPEN_MODEL_LISTQUEUECONSUMERSREQUEST_H_ \ No newline at end of file diff --git a/amqp-open/include/alibabacloud/amqp-open/model/ListQueueConsumersResult.h b/amqp-open/include/alibabacloud/amqp-open/model/ListQueueConsumersResult.h new file mode 100644 index 000000000..b4a8714d1 --- /dev/null +++ b/amqp-open/include/alibabacloud/amqp-open/model/ListQueueConsumersResult.h @@ -0,0 +1,61 @@ +/* + * 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_AMQP_OPEN_MODEL_LISTQUEUECONSUMERSRESULT_H_ +#define ALIBABACLOUD_AMQP_OPEN_MODEL_LISTQUEUECONSUMERSRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Amqp_open + { + namespace Model + { + class ALIBABACLOUD_AMQP_OPEN_EXPORT ListQueueConsumersResult : public ServiceResult + { + public: + struct Data + { + struct QueueConsumerVO + { + std::string consumerTag; + }; + std::string nextToken; + std::vector consumers; + int maxResults; + }; + + + ListQueueConsumersResult(); + explicit ListQueueConsumersResult(const std::string &payload); + ~ListQueueConsumersResult(); + Data getData()const; + + protected: + void parse(const std::string &payload); + private: + Data data_; + + }; + } + } +} +#endif // !ALIBABACLOUD_AMQP_OPEN_MODEL_LISTQUEUECONSUMERSRESULT_H_ \ No newline at end of file diff --git a/amqp-open/src/Amqp-openClient.cc b/amqp-open/src/Amqp-openClient.cc index 170f3e1dd..ab9cf7879 100644 --- a/amqp-open/src/Amqp-openClient.cc +++ b/amqp-open/src/Amqp-openClient.cc @@ -339,6 +339,42 @@ Amqp_openClient::DeleteVirtualHostOutcomeCallable Amqp_openClient::deleteVirtual return task->get_future(); } +Amqp_openClient::GetMetadataAmountOutcome Amqp_openClient::getMetadataAmount(const GetMetadataAmountRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return GetMetadataAmountOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return GetMetadataAmountOutcome(GetMetadataAmountResult(outcome.result())); + else + return GetMetadataAmountOutcome(outcome.error()); +} + +void Amqp_openClient::getMetadataAmountAsync(const GetMetadataAmountRequest& request, const GetMetadataAmountAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, getMetadataAmount(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +Amqp_openClient::GetMetadataAmountOutcomeCallable Amqp_openClient::getMetadataAmountCallable(const GetMetadataAmountRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->getMetadataAmount(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + Amqp_openClient::ListBindingsOutcome Amqp_openClient::listBindings(const ListBindingsRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); @@ -519,6 +555,42 @@ Amqp_openClient::ListInstancesOutcomeCallable Amqp_openClient::listInstancesCall return task->get_future(); } +Amqp_openClient::ListQueueConsumersOutcome Amqp_openClient::listQueueConsumers(const ListQueueConsumersRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return ListQueueConsumersOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return ListQueueConsumersOutcome(ListQueueConsumersResult(outcome.result())); + else + return ListQueueConsumersOutcome(outcome.error()); +} + +void Amqp_openClient::listQueueConsumersAsync(const ListQueueConsumersRequest& request, const ListQueueConsumersAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, listQueueConsumers(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +Amqp_openClient::ListQueueConsumersOutcomeCallable Amqp_openClient::listQueueConsumersCallable(const ListQueueConsumersRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->listQueueConsumers(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + Amqp_openClient::ListQueueUpStreamBindingsOutcome Amqp_openClient::listQueueUpStreamBindings(const ListQueueUpStreamBindingsRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); diff --git a/amqp-open/src/model/GetMetadataAmountRequest.cc b/amqp-open/src/model/GetMetadataAmountRequest.cc new file mode 100644 index 000000000..1480fc8c2 --- /dev/null +++ b/amqp-open/src/model/GetMetadataAmountRequest.cc @@ -0,0 +1,40 @@ +/* + * 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::Amqp_open::Model::GetMetadataAmountRequest; + +GetMetadataAmountRequest::GetMetadataAmountRequest() : + RpcServiceRequest("amqp-open", "2019-12-12", "GetMetadataAmount") +{ + setMethod(HttpRequest::Method::Get); +} + +GetMetadataAmountRequest::~GetMetadataAmountRequest() +{} + +std::string GetMetadataAmountRequest::getInstanceId()const +{ + return instanceId_; +} + +void GetMetadataAmountRequest::setInstanceId(const std::string& instanceId) +{ + instanceId_ = instanceId; + setParameter("InstanceId", instanceId); +} + diff --git a/amqp-open/src/model/GetMetadataAmountResult.cc b/amqp-open/src/model/GetMetadataAmountResult.cc new file mode 100644 index 000000000..606058016 --- /dev/null +++ b/amqp-open/src/model/GetMetadataAmountResult.cc @@ -0,0 +1,62 @@ +/* + * 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::Amqp_open; +using namespace AlibabaCloud::Amqp_open::Model; + +GetMetadataAmountResult::GetMetadataAmountResult() : + ServiceResult() +{} + +GetMetadataAmountResult::GetMetadataAmountResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +GetMetadataAmountResult::~GetMetadataAmountResult() +{} + +void GetMetadataAmountResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto dataNode = value["Data"]; + if(!dataNode["CurrentVirtualHosts"].isNull()) + data_.currentVirtualHosts = std::stoi(dataNode["CurrentVirtualHosts"].asString()); + if(!dataNode["MaxVirtualHosts"].isNull()) + data_.maxVirtualHosts = std::stoi(dataNode["MaxVirtualHosts"].asString()); + if(!dataNode["CurrentExchanges"].isNull()) + data_.currentExchanges = std::stoi(dataNode["CurrentExchanges"].asString()); + if(!dataNode["MaxExchanges"].isNull()) + data_.maxExchanges = std::stoi(dataNode["MaxExchanges"].asString()); + if(!dataNode["CurrentQueues"].isNull()) + data_.currentQueues = std::stoi(dataNode["CurrentQueues"].asString()); + if(!dataNode["MaxQueues"].isNull()) + data_.maxQueues = std::stoi(dataNode["MaxQueues"].asString()); + +} + +GetMetadataAmountResult::Data GetMetadataAmountResult::getData()const +{ + return data_; +} + diff --git a/amqp-open/src/model/ListQueueConsumersRequest.cc b/amqp-open/src/model/ListQueueConsumersRequest.cc new file mode 100644 index 000000000..bebadb425 --- /dev/null +++ b/amqp-open/src/model/ListQueueConsumersRequest.cc @@ -0,0 +1,84 @@ +/* + * 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::Amqp_open::Model::ListQueueConsumersRequest; + +ListQueueConsumersRequest::ListQueueConsumersRequest() : + RpcServiceRequest("amqp-open", "2019-12-12", "ListQueueConsumers") +{ + setMethod(HttpRequest::Method::Get); +} + +ListQueueConsumersRequest::~ListQueueConsumersRequest() +{} + +std::string ListQueueConsumersRequest::getInstanceId()const +{ + return instanceId_; +} + +void ListQueueConsumersRequest::setInstanceId(const std::string& instanceId) +{ + instanceId_ = instanceId; + setParameter("InstanceId", instanceId); +} + +std::string ListQueueConsumersRequest::getNextToken()const +{ + return nextToken_; +} + +void ListQueueConsumersRequest::setNextToken(const std::string& nextToken) +{ + nextToken_ = nextToken; + setParameter("NextToken", nextToken); +} + +int ListQueueConsumersRequest::getQueryCount()const +{ + return queryCount_; +} + +void ListQueueConsumersRequest::setQueryCount(int queryCount) +{ + queryCount_ = queryCount; + setParameter("QueryCount", std::to_string(queryCount)); +} + +std::string ListQueueConsumersRequest::getVirtualHost()const +{ + return virtualHost_; +} + +void ListQueueConsumersRequest::setVirtualHost(const std::string& virtualHost) +{ + virtualHost_ = virtualHost; + setParameter("VirtualHost", virtualHost); +} + +std::string ListQueueConsumersRequest::getQueue()const +{ + return queue_; +} + +void ListQueueConsumersRequest::setQueue(const std::string& queue) +{ + queue_ = queue; + setParameter("Queue", queue); +} + diff --git a/amqp-open/src/model/ListQueueConsumersResult.cc b/amqp-open/src/model/ListQueueConsumersResult.cc new file mode 100644 index 000000000..bf58b4aed --- /dev/null +++ b/amqp-open/src/model/ListQueueConsumersResult.cc @@ -0,0 +1,62 @@ +/* + * 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::Amqp_open; +using namespace AlibabaCloud::Amqp_open::Model; + +ListQueueConsumersResult::ListQueueConsumersResult() : + ServiceResult() +{} + +ListQueueConsumersResult::ListQueueConsumersResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +ListQueueConsumersResult::~ListQueueConsumersResult() +{} + +void ListQueueConsumersResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto dataNode = value["Data"]; + if(!dataNode["NextToken"].isNull()) + data_.nextToken = dataNode["NextToken"].asString(); + if(!dataNode["MaxResults"].isNull()) + data_.maxResults = std::stoi(dataNode["MaxResults"].asString()); + auto allConsumersNode = dataNode["Consumers"]["QueueConsumerVO"]; + for (auto dataNodeConsumersQueueConsumerVO : allConsumersNode) + { + Data::QueueConsumerVO queueConsumerVOObject; + if(!dataNodeConsumersQueueConsumerVO["ConsumerTag"].isNull()) + queueConsumerVOObject.consumerTag = dataNodeConsumersQueueConsumerVO["ConsumerTag"].asString(); + data_.consumers.push_back(queueConsumerVOObject); + } + +} + +ListQueueConsumersResult::Data ListQueueConsumersResult::getData()const +{ + return data_; +} +