This commit is contained in:
sdk-team
2023-02-21 06:42:06 +00:00
parent cbcd585696
commit 6396bde1d4
12 changed files with 287 additions and 4 deletions

View File

@@ -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/ListCardUsagesRequest.h
include/alibabacloud/cc5g/model/ListCardUsagesResult.h
include/alibabacloud/cc5g/model/ListCardsRequest.h
include/alibabacloud/cc5g/model/ListCardsResult.h
include/alibabacloud/cc5g/model/ListDataPackagesRequest.h
@@ -188,6 +190,8 @@ set(cc5g_src
src/model/ListAuthorizationRulesResult.cc
src/model/ListBatchOperateCardsTasksRequest.cc
src/model/ListBatchOperateCardsTasksResult.cc
src/model/ListCardUsagesRequest.cc
src/model/ListCardUsagesResult.cc
src/model/ListCardsRequest.cc
src/model/ListCardsResult.cc
src/model/ListDataPackagesRequest.cc

View File

@@ -76,6 +76,8 @@
#include "model/ListAuthorizationRulesResult.h"
#include "model/ListBatchOperateCardsTasksRequest.h"
#include "model/ListBatchOperateCardsTasksResult.h"
#include "model/ListCardUsagesRequest.h"
#include "model/ListCardUsagesResult.h"
#include "model/ListCardsRequest.h"
#include "model/ListCardsResult.h"
#include "model/ListDataPackagesRequest.h"
@@ -222,6 +224,9 @@ namespace AlibabaCloud
typedef Outcome<Error, Model::ListBatchOperateCardsTasksResult> ListBatchOperateCardsTasksOutcome;
typedef std::future<ListBatchOperateCardsTasksOutcome> ListBatchOperateCardsTasksOutcomeCallable;
typedef std::function<void(const CC5GClient*, const Model::ListBatchOperateCardsTasksRequest&, const ListBatchOperateCardsTasksOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ListBatchOperateCardsTasksAsyncHandler;
typedef Outcome<Error, Model::ListCardUsagesResult> ListCardUsagesOutcome;
typedef std::future<ListCardUsagesOutcome> ListCardUsagesOutcomeCallable;
typedef std::function<void(const CC5GClient*, const Model::ListCardUsagesRequest&, const ListCardUsagesOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ListCardUsagesAsyncHandler;
typedef Outcome<Error, Model::ListCardsResult> ListCardsOutcome;
typedef std::future<ListCardsOutcome> ListCardsOutcomeCallable;
typedef std::function<void(const CC5GClient*, const Model::ListCardsRequest&, const ListCardsOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ListCardsAsyncHandler;
@@ -392,6 +397,9 @@ namespace AlibabaCloud
ListBatchOperateCardsTasksOutcome listBatchOperateCardsTasks(const Model::ListBatchOperateCardsTasksRequest &request)const;
void listBatchOperateCardsTasksAsync(const Model::ListBatchOperateCardsTasksRequest& request, const ListBatchOperateCardsTasksAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
ListBatchOperateCardsTasksOutcomeCallable listBatchOperateCardsTasksCallable(const Model::ListBatchOperateCardsTasksRequest& request) const;
ListCardUsagesOutcome listCardUsages(const Model::ListCardUsagesRequest &request)const;
void listCardUsagesAsync(const Model::ListCardUsagesRequest& request, const ListCardUsagesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
ListCardUsagesOutcomeCallable listCardUsagesCallable(const Model::ListCardUsagesRequest& request) const;
ListCardsOutcome listCards(const Model::ListCardsRequest &request)const;
void listCardsAsync(const Model::ListCardsRequest& request, const ListCardsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
ListCardsOutcomeCallable listCardsCallable(const Model::ListCardsRequest& request) const;

View File

@@ -37,10 +37,18 @@ namespace AlibabaCloud
std::string errorDesc;
std::string errorSuggestion;
std::string errorLevel;
std::string errorItem;
std::string errorPart;
};
struct DiagnoseItemItem
{
struct SubItemsItem
{
std::string subItem;
std::string subItemStatus;
std::string subItemInfo;
};
std::vector<DiagnoseItemItem::SubItemsItem> subItems;
std::string status;
std::string part;
};

View File

@@ -0,0 +1,45 @@
/*
* 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_LISTCARDUSAGESREQUEST_H_
#define ALIBABACLOUD_CC5G_MODEL_LISTCARDUSAGESREQUEST_H_
#include <alibabacloud/cc5g/CC5GExport.h>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <string>
#include <vector>
#include <map>
namespace AlibabaCloud {
namespace CC5G {
namespace Model {
class ALIBABACLOUD_CC5G_EXPORT ListCardUsagesRequest : public RpcServiceRequest {
public:
ListCardUsagesRequest();
~ListCardUsagesRequest();
std::vector<std::string> getIccids() const;
void setIccids(const std::vector<std::string> &iccids);
std::string getWirelessCloudConnectorId() const;
void setWirelessCloudConnectorId(const std::string &wirelessCloudConnectorId);
private:
std::vector<std::string> iccids_;
std::string wirelessCloudConnectorId_;
};
} // namespace Model
} // namespace CC5G
} // namespace AlibabaCloud
#endif // !ALIBABACLOUD_CC5G_MODEL_LISTCARDUSAGESREQUEST_H_

View File

@@ -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_CC5G_MODEL_LISTCARDUSAGESRESULT_H_
#define ALIBABACLOUD_CC5G_MODEL_LISTCARDUSAGESRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/cc5g/CC5GExport.h>
namespace AlibabaCloud
{
namespace CC5G
{
namespace Model
{
class ALIBABACLOUD_CC5G_EXPORT ListCardUsagesResult : public ServiceResult
{
public:
struct Card
{
long usageDataMonth;
std::string iccid;
};
ListCardUsagesResult();
explicit ListCardUsagesResult(const std::string &payload);
~ListCardUsagesResult();
std::string getTotalCount()const;
std::vector<Card> getCards()const;
protected:
void parse(const std::string &payload);
private:
std::string totalCount_;
std::vector<Card> cards_;
};
}
}
}
#endif // !ALIBABACLOUD_CC5G_MODEL_LISTCARDUSAGESRESULT_H_

View File

@@ -35,7 +35,6 @@ namespace AlibabaCloud
struct Region
{
std::string regionId;
std::string regionEndpoint;
std::string localName;
};

View File

@@ -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();

View File

@@ -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())

View 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);
}

View 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_;
}

View File

@@ -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);
}