Cc5g.
This commit is contained in:
@@ -1023,6 +1023,42 @@ CC5GClient::ListBatchOperateCardsTasksOutcomeCallable CC5GClient::listBatchOpera
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
CC5GClient::ListCardUsagesOutcome CC5GClient::listCardUsages(const ListCardUsagesRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return ListCardUsagesOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return ListCardUsagesOutcome(ListCardUsagesResult(outcome.result()));
|
||||
else
|
||||
return ListCardUsagesOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void CC5GClient::listCardUsagesAsync(const ListCardUsagesRequest& request, const ListCardUsagesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, listCardUsages(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
CC5GClient::ListCardUsagesOutcomeCallable CC5GClient::listCardUsagesCallable(const ListCardUsagesRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<ListCardUsagesOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->listCardUsages(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
CC5GClient::ListCardsOutcome CC5GClient::listCards(const ListCardsRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
|
||||
@@ -47,6 +47,8 @@ void GetDiagnoseResultForSingleCardResult::parse(const std::string &payload)
|
||||
errorResultObject.errorLevel = valueErrorResultdiagnoseResult["ErrorLevel"].asString();
|
||||
if(!valueErrorResultdiagnoseResult["ErrorPart"].isNull())
|
||||
errorResultObject.errorPart = valueErrorResultdiagnoseResult["ErrorPart"].asString();
|
||||
if(!valueErrorResultdiagnoseResult["ErrorItem"].isNull())
|
||||
errorResultObject.errorItem = valueErrorResultdiagnoseResult["ErrorItem"].asString();
|
||||
if(!valueErrorResultdiagnoseResult["ErrorDesc"].isNull())
|
||||
errorResultObject.errorDesc = valueErrorResultdiagnoseResult["ErrorDesc"].asString();
|
||||
if(!valueErrorResultdiagnoseResult["ErrorSuggestion"].isNull())
|
||||
@@ -61,6 +63,18 @@ void GetDiagnoseResultForSingleCardResult::parse(const std::string &payload)
|
||||
diagnoseItemObject.part = valueDiagnoseItemdiagnoseItemItem["Part"].asString();
|
||||
if(!valueDiagnoseItemdiagnoseItemItem["Status"].isNull())
|
||||
diagnoseItemObject.status = valueDiagnoseItemdiagnoseItemItem["Status"].asString();
|
||||
auto allSubItemsNode = valueDiagnoseItemdiagnoseItemItem["SubItems"]["subItemsItem"];
|
||||
for (auto valueDiagnoseItemdiagnoseItemItemSubItemssubItemsItem : allSubItemsNode)
|
||||
{
|
||||
DiagnoseItemItem::SubItemsItem subItemsObject;
|
||||
if(!valueDiagnoseItemdiagnoseItemItemSubItemssubItemsItem["SubItem"].isNull())
|
||||
subItemsObject.subItem = valueDiagnoseItemdiagnoseItemItemSubItemssubItemsItem["SubItem"].asString();
|
||||
if(!valueDiagnoseItemdiagnoseItemItemSubItemssubItemsItem["SubItemStatus"].isNull())
|
||||
subItemsObject.subItemStatus = valueDiagnoseItemdiagnoseItemItemSubItemssubItemsItem["SubItemStatus"].asString();
|
||||
if(!valueDiagnoseItemdiagnoseItemItemSubItemssubItemsItem["SubItemInfo"].isNull())
|
||||
subItemsObject.subItemInfo = valueDiagnoseItemdiagnoseItemItemSubItemssubItemsItem["SubItemInfo"].asString();
|
||||
diagnoseItemObject.subItems.push_back(subItemsObject);
|
||||
}
|
||||
diagnoseItem_.push_back(diagnoseItemObject);
|
||||
}
|
||||
if(!value["WirelessCloudConnectorId"].isNull())
|
||||
|
||||
47
cc5g/src/model/ListCardUsagesRequest.cc
Normal file
47
cc5g/src/model/ListCardUsagesRequest.cc
Normal file
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* 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 <alibabacloud/cc5g/model/ListCardUsagesRequest.h>
|
||||
|
||||
using AlibabaCloud::CC5G::Model::ListCardUsagesRequest;
|
||||
|
||||
ListCardUsagesRequest::ListCardUsagesRequest()
|
||||
: RpcServiceRequest("cc5g", "2022-03-14", "ListCardUsages") {
|
||||
setMethod(HttpRequest::Method::Get);
|
||||
}
|
||||
|
||||
ListCardUsagesRequest::~ListCardUsagesRequest() {}
|
||||
|
||||
std::vector<ListCardUsagesRequest::std::string> ListCardUsagesRequest::getIccids() const {
|
||||
return iccids_;
|
||||
}
|
||||
|
||||
void ListCardUsagesRequest::setIccids(const std::vector<ListCardUsagesRequest::std::string> &iccids) {
|
||||
iccids_ = iccids;
|
||||
for(int dep1 = 0; dep1 != iccids.size(); dep1++) {
|
||||
setParameter(std::string("Iccids") + "." + std::to_string(dep1 + 1), iccids[dep1]);
|
||||
}
|
||||
}
|
||||
|
||||
std::string ListCardUsagesRequest::getWirelessCloudConnectorId() const {
|
||||
return wirelessCloudConnectorId_;
|
||||
}
|
||||
|
||||
void ListCardUsagesRequest::setWirelessCloudConnectorId(const std::string &wirelessCloudConnectorId) {
|
||||
wirelessCloudConnectorId_ = wirelessCloudConnectorId;
|
||||
setParameter(std::string("WirelessCloudConnectorId"), wirelessCloudConnectorId);
|
||||
}
|
||||
|
||||
66
cc5g/src/model/ListCardUsagesResult.cc
Normal file
66
cc5g/src/model/ListCardUsagesResult.cc
Normal file
@@ -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 <alibabacloud/cc5g/model/ListCardUsagesResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::CC5G;
|
||||
using namespace AlibabaCloud::CC5G::Model;
|
||||
|
||||
ListCardUsagesResult::ListCardUsagesResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
ListCardUsagesResult::ListCardUsagesResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
ListCardUsagesResult::~ListCardUsagesResult()
|
||||
{}
|
||||
|
||||
void ListCardUsagesResult::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();
|
||||
if(!valueCardsCard["UsageDataMonth"].isNull())
|
||||
cardsObject.usageDataMonth = std::stol(valueCardsCard["UsageDataMonth"].asString());
|
||||
cards_.push_back(cardsObject);
|
||||
}
|
||||
if(!value["TotalCount"].isNull())
|
||||
totalCount_ = value["TotalCount"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string ListCardUsagesResult::getTotalCount()const
|
||||
{
|
||||
return totalCount_;
|
||||
}
|
||||
|
||||
std::vector<ListCardUsagesResult::Card> ListCardUsagesResult::getCards()const
|
||||
{
|
||||
return cards_;
|
||||
}
|
||||
|
||||
@@ -47,8 +47,6 @@ void ListRegionsResult::parse(const std::string &payload)
|
||||
regionsObject.regionId = valueRegionsRegion["RegionId"].asString();
|
||||
if(!valueRegionsRegion["LocalName"].isNull())
|
||||
regionsObject.localName = valueRegionsRegion["LocalName"].asString();
|
||||
if(!valueRegionsRegion["RegionEndpoint"].isNull())
|
||||
regionsObject.regionEndpoint = valueRegionsRegion["RegionEndpoint"].asString();
|
||||
regions_.push_back(regionsObject);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user