From 4b1dc6a6c3879f68d1a89849e98d0911d23f7fbc Mon Sep 17 00:00:00 2001 From: sdk-team Date: Thu, 27 Apr 2023 09:21:28 +0000 Subject: [PATCH] Cc5g. --- VERSION | 2 +- cc5g/CMakeLists.txt | 4 + cc5g/include/alibabacloud/cc5g/CC5GClient.h | 8 ++ .../cc5g/model/ListCardDayUsagesRequest.h | 48 ++++++++++++ .../cc5g/model/ListCardDayUsagesResult.h | 67 ++++++++++++++++ cc5g/src/CC5GClient.cc | 36 +++++++++ cc5g/src/model/ListCardDayUsagesRequest.cc | 56 ++++++++++++++ cc5g/src/model/ListCardDayUsagesResult.cc | 77 +++++++++++++++++++ 8 files changed, 297 insertions(+), 1 deletion(-) create mode 100644 cc5g/include/alibabacloud/cc5g/model/ListCardDayUsagesRequest.h create mode 100644 cc5g/include/alibabacloud/cc5g/model/ListCardDayUsagesResult.h create mode 100644 cc5g/src/model/ListCardDayUsagesRequest.cc create mode 100644 cc5g/src/model/ListCardDayUsagesResult.cc diff --git a/VERSION b/VERSION index 2788da1d7..503fc3df3 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.1545 \ No newline at end of file +1.36.1546 \ No newline at end of file diff --git a/cc5g/CMakeLists.txt b/cc5g/CMakeLists.txt index 1d9a3fa23..174a2fa21 100644 --- a/cc5g/CMakeLists.txt +++ b/cc5g/CMakeLists.txt @@ -75,6 +75,8 @@ set(cc5g_public_header_model include/alibabacloud/cc5g/model/ListAuthorizationRulesResult.h include/alibabacloud/cc5g/model/ListBatchOperateCardsTasksRequest.h include/alibabacloud/cc5g/model/ListBatchOperateCardsTasksResult.h + include/alibabacloud/cc5g/model/ListCardDayUsagesRequest.h + include/alibabacloud/cc5g/model/ListCardDayUsagesResult.h include/alibabacloud/cc5g/model/ListCardUsagesRequest.h include/alibabacloud/cc5g/model/ListCardUsagesResult.h include/alibabacloud/cc5g/model/ListCardsRequest.h @@ -192,6 +194,8 @@ set(cc5g_src src/model/ListAuthorizationRulesResult.cc src/model/ListBatchOperateCardsTasksRequest.cc src/model/ListBatchOperateCardsTasksResult.cc + src/model/ListCardDayUsagesRequest.cc + src/model/ListCardDayUsagesResult.cc src/model/ListCardUsagesRequest.cc src/model/ListCardUsagesResult.cc src/model/ListCardsRequest.cc diff --git a/cc5g/include/alibabacloud/cc5g/CC5GClient.h b/cc5g/include/alibabacloud/cc5g/CC5GClient.h index 8f521d084..e5e76af94 100644 --- a/cc5g/include/alibabacloud/cc5g/CC5GClient.h +++ b/cc5g/include/alibabacloud/cc5g/CC5GClient.h @@ -76,6 +76,8 @@ #include "model/ListAuthorizationRulesResult.h" #include "model/ListBatchOperateCardsTasksRequest.h" #include "model/ListBatchOperateCardsTasksResult.h" +#include "model/ListCardDayUsagesRequest.h" +#include "model/ListCardDayUsagesResult.h" #include "model/ListCardUsagesRequest.h" #include "model/ListCardUsagesResult.h" #include "model/ListCardsRequest.h" @@ -226,6 +228,9 @@ namespace AlibabaCloud typedef Outcome ListBatchOperateCardsTasksOutcome; typedef std::future ListBatchOperateCardsTasksOutcomeCallable; typedef std::function&)> ListBatchOperateCardsTasksAsyncHandler; + typedef Outcome ListCardDayUsagesOutcome; + typedef std::future ListCardDayUsagesOutcomeCallable; + typedef std::function&)> ListCardDayUsagesAsyncHandler; typedef Outcome ListCardUsagesOutcome; typedef std::future ListCardUsagesOutcomeCallable; typedef std::function&)> ListCardUsagesAsyncHandler; @@ -402,6 +407,9 @@ namespace AlibabaCloud ListBatchOperateCardsTasksOutcome listBatchOperateCardsTasks(const Model::ListBatchOperateCardsTasksRequest &request)const; void listBatchOperateCardsTasksAsync(const Model::ListBatchOperateCardsTasksRequest& request, const ListBatchOperateCardsTasksAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; ListBatchOperateCardsTasksOutcomeCallable listBatchOperateCardsTasksCallable(const Model::ListBatchOperateCardsTasksRequest& request) const; + ListCardDayUsagesOutcome listCardDayUsages(const Model::ListCardDayUsagesRequest &request)const; + void listCardDayUsagesAsync(const Model::ListCardDayUsagesRequest& request, const ListCardDayUsagesAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + ListCardDayUsagesOutcomeCallable listCardDayUsagesCallable(const Model::ListCardDayUsagesRequest& request) const; ListCardUsagesOutcome listCardUsages(const Model::ListCardUsagesRequest &request)const; void listCardUsagesAsync(const Model::ListCardUsagesRequest& request, const ListCardUsagesAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; ListCardUsagesOutcomeCallable listCardUsagesCallable(const Model::ListCardUsagesRequest& request) const; diff --git a/cc5g/include/alibabacloud/cc5g/model/ListCardDayUsagesRequest.h b/cc5g/include/alibabacloud/cc5g/model/ListCardDayUsagesRequest.h new file mode 100644 index 000000000..b5162669b --- /dev/null +++ b/cc5g/include/alibabacloud/cc5g/model/ListCardDayUsagesRequest.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_CC5G_MODEL_LISTCARDDAYUSAGESREQUEST_H_ +#define ALIBABACLOUD_CC5G_MODEL_LISTCARDDAYUSAGESREQUEST_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud { +namespace CC5G { +namespace Model { +class ALIBABACLOUD_CC5G_EXPORT ListCardDayUsagesRequest : public RpcServiceRequest { +public: + ListCardDayUsagesRequest(); + ~ListCardDayUsagesRequest(); + int getLatestMonthNum() const; + void setLatestMonthNum(int latestMonthNum); + std::vector getIccids() const; + void setIccids(const std::vector &iccids); + std::string getWirelessCloudConnectorId() const; + void setWirelessCloudConnectorId(const std::string &wirelessCloudConnectorId); + +private: + int latestMonthNum_; + std::vector iccids_; + std::string wirelessCloudConnectorId_; +}; +} // namespace Model +} // namespace CC5G +} // namespace AlibabaCloud +#endif // !ALIBABACLOUD_CC5G_MODEL_LISTCARDDAYUSAGESREQUEST_H_ diff --git a/cc5g/include/alibabacloud/cc5g/model/ListCardDayUsagesResult.h b/cc5g/include/alibabacloud/cc5g/model/ListCardDayUsagesResult.h new file mode 100644 index 000000000..20598edfe --- /dev/null +++ b/cc5g/include/alibabacloud/cc5g/model/ListCardDayUsagesResult.h @@ -0,0 +1,67 @@ +/* + * 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_CC5G_MODEL_LISTCARDDAYUSAGESRESULT_H_ +#define ALIBABACLOUD_CC5G_MODEL_LISTCARDDAYUSAGESRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace CC5G + { + namespace Model + { + class ALIBABACLOUD_CC5G_EXPORT ListCardDayUsagesResult : public ServiceResult + { + public: + struct Card + { + struct UsageDataMonth + { + struct CardDayUsage + { + std::string usageData; + std::string day; + }; + std::string month; + std::string usageDataMonth; + std::vector cardDayUsages; + }; + std::vector usageDataMonths; + std::string iccid; + }; + + + ListCardDayUsagesResult(); + explicit ListCardDayUsagesResult(const std::string &payload); + ~ListCardDayUsagesResult(); + std::vector getCards()const; + + protected: + void parse(const std::string &payload); + private: + std::vector cards_; + + }; + } + } +} +#endif // !ALIBABACLOUD_CC5G_MODEL_LISTCARDDAYUSAGESRESULT_H_ \ No newline at end of file diff --git a/cc5g/src/CC5GClient.cc b/cc5g/src/CC5GClient.cc index 1ce9999bb..c537b94b2 100644 --- a/cc5g/src/CC5GClient.cc +++ b/cc5g/src/CC5GClient.cc @@ -1023,6 +1023,42 @@ CC5GClient::ListBatchOperateCardsTasksOutcomeCallable CC5GClient::listBatchOpera return task->get_future(); } +CC5GClient::ListCardDayUsagesOutcome CC5GClient::listCardDayUsages(const ListCardDayUsagesRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return ListCardDayUsagesOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return ListCardDayUsagesOutcome(ListCardDayUsagesResult(outcome.result())); + else + return ListCardDayUsagesOutcome(outcome.error()); +} + +void CC5GClient::listCardDayUsagesAsync(const ListCardDayUsagesRequest& request, const ListCardDayUsagesAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, listCardDayUsages(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +CC5GClient::ListCardDayUsagesOutcomeCallable CC5GClient::listCardDayUsagesCallable(const ListCardDayUsagesRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->listCardDayUsages(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + CC5GClient::ListCardUsagesOutcome CC5GClient::listCardUsages(const ListCardUsagesRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); diff --git a/cc5g/src/model/ListCardDayUsagesRequest.cc b/cc5g/src/model/ListCardDayUsagesRequest.cc new file mode 100644 index 000000000..6251d3e46 --- /dev/null +++ b/cc5g/src/model/ListCardDayUsagesRequest.cc @@ -0,0 +1,56 @@ +/* + * 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::CC5G::Model::ListCardDayUsagesRequest; + +ListCardDayUsagesRequest::ListCardDayUsagesRequest() + : RpcServiceRequest("cc5g", "2022-03-14", "ListCardDayUsages") { + setMethod(HttpRequest::Method::Get); +} + +ListCardDayUsagesRequest::~ListCardDayUsagesRequest() {} + +int ListCardDayUsagesRequest::getLatestMonthNum() const { + return latestMonthNum_; +} + +void ListCardDayUsagesRequest::setLatestMonthNum(int latestMonthNum) { + latestMonthNum_ = latestMonthNum; + setParameter(std::string("LatestMonthNum"), std::to_string(latestMonthNum)); +} + +std::vector ListCardDayUsagesRequest::getIccids() const { + return iccids_; +} + +void ListCardDayUsagesRequest::setIccids(const std::vector &iccids) { + iccids_ = iccids; + for(int dep1 = 0; dep1 != iccids.size(); dep1++) { + setParameter(std::string("Iccids") + "." + std::to_string(dep1 + 1), iccids[dep1]); + } +} + +std::string ListCardDayUsagesRequest::getWirelessCloudConnectorId() const { + return wirelessCloudConnectorId_; +} + +void ListCardDayUsagesRequest::setWirelessCloudConnectorId(const std::string &wirelessCloudConnectorId) { + wirelessCloudConnectorId_ = wirelessCloudConnectorId; + setParameter(std::string("WirelessCloudConnectorId"), wirelessCloudConnectorId); +} + diff --git a/cc5g/src/model/ListCardDayUsagesResult.cc b/cc5g/src/model/ListCardDayUsagesResult.cc new file mode 100644 index 000000000..7ed9c0bb6 --- /dev/null +++ b/cc5g/src/model/ListCardDayUsagesResult.cc @@ -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. + */ + +#include +#include + +using namespace AlibabaCloud::CC5G; +using namespace AlibabaCloud::CC5G::Model; + +ListCardDayUsagesResult::ListCardDayUsagesResult() : + ServiceResult() +{} + +ListCardDayUsagesResult::ListCardDayUsagesResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +ListCardDayUsagesResult::~ListCardDayUsagesResult() +{} + +void ListCardDayUsagesResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto allCardsNode = value["Cards"]["Card"]; + for (auto valueCardsCard : allCardsNode) + { + Card cardsObject; + if(!valueCardsCard["Iccid"].isNull()) + cardsObject.iccid = valueCardsCard["Iccid"].asString(); + auto allUsageDataMonthsNode = valueCardsCard["UsageDataMonths"]["UsageDataMonth"]; + for (auto valueCardsCardUsageDataMonthsUsageDataMonth : allUsageDataMonthsNode) + { + Card::UsageDataMonth usageDataMonthsObject; + if(!valueCardsCardUsageDataMonthsUsageDataMonth["UsageDataMonth"].isNull()) + usageDataMonthsObject.usageDataMonth = valueCardsCardUsageDataMonthsUsageDataMonth["UsageDataMonth"].asString(); + if(!valueCardsCardUsageDataMonthsUsageDataMonth["Month"].isNull()) + usageDataMonthsObject.month = valueCardsCardUsageDataMonthsUsageDataMonth["Month"].asString(); + auto allCardDayUsagesNode = valueCardsCardUsageDataMonthsUsageDataMonth["CardDayUsages"]["CardDayUsage"]; + for (auto valueCardsCardUsageDataMonthsUsageDataMonthCardDayUsagesCardDayUsage : allCardDayUsagesNode) + { + Card::UsageDataMonth::CardDayUsage cardDayUsagesObject; + if(!valueCardsCardUsageDataMonthsUsageDataMonthCardDayUsagesCardDayUsage["Day"].isNull()) + cardDayUsagesObject.day = valueCardsCardUsageDataMonthsUsageDataMonthCardDayUsagesCardDayUsage["Day"].asString(); + if(!valueCardsCardUsageDataMonthsUsageDataMonthCardDayUsagesCardDayUsage["UsageData"].isNull()) + cardDayUsagesObject.usageData = valueCardsCardUsageDataMonthsUsageDataMonthCardDayUsagesCardDayUsage["UsageData"].asString(); + usageDataMonthsObject.cardDayUsages.push_back(cardDayUsagesObject); + } + cardsObject.usageDataMonths.push_back(usageDataMonthsObject); + } + cards_.push_back(cardsObject); + } + +} + +std::vector ListCardDayUsagesResult::getCards()const +{ + return cards_; +} +