Supported DescribeSavingsPlansUsageTotal.

This commit is contained in:
sdk-team
2021-08-10 09:13:31 +00:00
parent 11e315b724
commit 5df0ee7c86
23 changed files with 1480 additions and 1 deletions

View File

@@ -771,6 +771,150 @@ BssOpenApiClient::DescribeResourceUsageTotalOutcomeCallable BssOpenApiClient::de
return task->get_future();
}
BssOpenApiClient::DescribeSavingsPlansCoverageDetailOutcome BssOpenApiClient::describeSavingsPlansCoverageDetail(const DescribeSavingsPlansCoverageDetailRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return DescribeSavingsPlansCoverageDetailOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return DescribeSavingsPlansCoverageDetailOutcome(DescribeSavingsPlansCoverageDetailResult(outcome.result()));
else
return DescribeSavingsPlansCoverageDetailOutcome(outcome.error());
}
void BssOpenApiClient::describeSavingsPlansCoverageDetailAsync(const DescribeSavingsPlansCoverageDetailRequest& request, const DescribeSavingsPlansCoverageDetailAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, describeSavingsPlansCoverageDetail(request), context);
};
asyncExecute(new Runnable(fn));
}
BssOpenApiClient::DescribeSavingsPlansCoverageDetailOutcomeCallable BssOpenApiClient::describeSavingsPlansCoverageDetailCallable(const DescribeSavingsPlansCoverageDetailRequest &request) const
{
auto task = std::make_shared<std::packaged_task<DescribeSavingsPlansCoverageDetailOutcome()>>(
[this, request]()
{
return this->describeSavingsPlansCoverageDetail(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
BssOpenApiClient::DescribeSavingsPlansCoverageTotalOutcome BssOpenApiClient::describeSavingsPlansCoverageTotal(const DescribeSavingsPlansCoverageTotalRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return DescribeSavingsPlansCoverageTotalOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return DescribeSavingsPlansCoverageTotalOutcome(DescribeSavingsPlansCoverageTotalResult(outcome.result()));
else
return DescribeSavingsPlansCoverageTotalOutcome(outcome.error());
}
void BssOpenApiClient::describeSavingsPlansCoverageTotalAsync(const DescribeSavingsPlansCoverageTotalRequest& request, const DescribeSavingsPlansCoverageTotalAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, describeSavingsPlansCoverageTotal(request), context);
};
asyncExecute(new Runnable(fn));
}
BssOpenApiClient::DescribeSavingsPlansCoverageTotalOutcomeCallable BssOpenApiClient::describeSavingsPlansCoverageTotalCallable(const DescribeSavingsPlansCoverageTotalRequest &request) const
{
auto task = std::make_shared<std::packaged_task<DescribeSavingsPlansCoverageTotalOutcome()>>(
[this, request]()
{
return this->describeSavingsPlansCoverageTotal(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
BssOpenApiClient::DescribeSavingsPlansUsageDetailOutcome BssOpenApiClient::describeSavingsPlansUsageDetail(const DescribeSavingsPlansUsageDetailRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return DescribeSavingsPlansUsageDetailOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return DescribeSavingsPlansUsageDetailOutcome(DescribeSavingsPlansUsageDetailResult(outcome.result()));
else
return DescribeSavingsPlansUsageDetailOutcome(outcome.error());
}
void BssOpenApiClient::describeSavingsPlansUsageDetailAsync(const DescribeSavingsPlansUsageDetailRequest& request, const DescribeSavingsPlansUsageDetailAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, describeSavingsPlansUsageDetail(request), context);
};
asyncExecute(new Runnable(fn));
}
BssOpenApiClient::DescribeSavingsPlansUsageDetailOutcomeCallable BssOpenApiClient::describeSavingsPlansUsageDetailCallable(const DescribeSavingsPlansUsageDetailRequest &request) const
{
auto task = std::make_shared<std::packaged_task<DescribeSavingsPlansUsageDetailOutcome()>>(
[this, request]()
{
return this->describeSavingsPlansUsageDetail(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
BssOpenApiClient::DescribeSavingsPlansUsageTotalOutcome BssOpenApiClient::describeSavingsPlansUsageTotal(const DescribeSavingsPlansUsageTotalRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return DescribeSavingsPlansUsageTotalOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return DescribeSavingsPlansUsageTotalOutcome(DescribeSavingsPlansUsageTotalResult(outcome.result()));
else
return DescribeSavingsPlansUsageTotalOutcome(outcome.error());
}
void BssOpenApiClient::describeSavingsPlansUsageTotalAsync(const DescribeSavingsPlansUsageTotalRequest& request, const DescribeSavingsPlansUsageTotalAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, describeSavingsPlansUsageTotal(request), context);
};
asyncExecute(new Runnable(fn));
}
BssOpenApiClient::DescribeSavingsPlansUsageTotalOutcomeCallable BssOpenApiClient::describeSavingsPlansUsageTotalCallable(const DescribeSavingsPlansUsageTotalRequest &request) const
{
auto task = std::make_shared<std::packaged_task<DescribeSavingsPlansUsageTotalOutcome()>>(
[this, request]()
{
return this->describeSavingsPlansUsageTotal(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
BssOpenApiClient::DescribeSplitItemBillOutcome BssOpenApiClient::describeSplitItemBill(const DescribeSplitItemBillRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();

View File

@@ -0,0 +1,95 @@
/*
* 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/bssopenapi/model/DescribeSavingsPlansCoverageDetailRequest.h>
using AlibabaCloud::BssOpenApi::Model::DescribeSavingsPlansCoverageDetailRequest;
DescribeSavingsPlansCoverageDetailRequest::DescribeSavingsPlansCoverageDetailRequest() :
RpcServiceRequest("bssopenapi", "2017-12-14", "DescribeSavingsPlansCoverageDetail")
{
setMethod(HttpRequest::Method::Post);
}
DescribeSavingsPlansCoverageDetailRequest::~DescribeSavingsPlansCoverageDetailRequest()
{}
std::string DescribeSavingsPlansCoverageDetailRequest::getPeriodType()const
{
return periodType_;
}
void DescribeSavingsPlansCoverageDetailRequest::setPeriodType(const std::string& periodType)
{
periodType_ = periodType;
setParameter("PeriodType", periodType);
}
long DescribeSavingsPlansCoverageDetailRequest::getBillOwnerId()const
{
return billOwnerId_;
}
void DescribeSavingsPlansCoverageDetailRequest::setBillOwnerId(long billOwnerId)
{
billOwnerId_ = billOwnerId;
setParameter("BillOwnerId", std::to_string(billOwnerId));
}
std::string DescribeSavingsPlansCoverageDetailRequest::getStartPeriod()const
{
return startPeriod_;
}
void DescribeSavingsPlansCoverageDetailRequest::setStartPeriod(const std::string& startPeriod)
{
startPeriod_ = startPeriod;
setParameter("StartPeriod", startPeriod);
}
std::string DescribeSavingsPlansCoverageDetailRequest::getEndPeriod()const
{
return endPeriod_;
}
void DescribeSavingsPlansCoverageDetailRequest::setEndPeriod(const std::string& endPeriod)
{
endPeriod_ = endPeriod;
setParameter("EndPeriod", endPeriod);
}
std::string DescribeSavingsPlansCoverageDetailRequest::getToken()const
{
return token_;
}
void DescribeSavingsPlansCoverageDetailRequest::setToken(const std::string& token)
{
token_ = token;
setParameter("Token", token);
}
int DescribeSavingsPlansCoverageDetailRequest::getMaxResults()const
{
return maxResults_;
}
void DescribeSavingsPlansCoverageDetailRequest::setMaxResults(int maxResults)
{
maxResults_ = maxResults;
setParameter("MaxResults", std::to_string(maxResults));
}

View File

@@ -0,0 +1,105 @@
/*
* 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/bssopenapi/model/DescribeSavingsPlansCoverageDetailResult.h>
#include <json/json.h>
using namespace AlibabaCloud::BssOpenApi;
using namespace AlibabaCloud::BssOpenApi::Model;
DescribeSavingsPlansCoverageDetailResult::DescribeSavingsPlansCoverageDetailResult() :
ServiceResult()
{}
DescribeSavingsPlansCoverageDetailResult::DescribeSavingsPlansCoverageDetailResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
DescribeSavingsPlansCoverageDetailResult::~DescribeSavingsPlansCoverageDetailResult()
{}
void DescribeSavingsPlansCoverageDetailResult::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["TotalCount"].isNull())
data_.totalCount = std::stoi(dataNode["TotalCount"].asString());
if(!dataNode["NextToken"].isNull())
data_.nextToken = dataNode["NextToken"].asString();
auto allItemsNode = dataNode["Items"]["Item"];
for (auto dataNodeItemsItem : allItemsNode)
{
Data::Item itemObject;
if(!dataNodeItemsItem["UserId"].isNull())
itemObject.userId = std::stol(dataNodeItemsItem["UserId"].asString());
if(!dataNodeItemsItem["UserName"].isNull())
itemObject.userName = dataNodeItemsItem["UserName"].asString();
if(!dataNodeItemsItem["InstanceId"].isNull())
itemObject.instanceId = dataNodeItemsItem["InstanceId"].asString();
if(!dataNodeItemsItem["Region"].isNull())
itemObject.region = dataNodeItemsItem["Region"].asString();
if(!dataNodeItemsItem["InstanceSpec"].isNull())
itemObject.instanceSpec = dataNodeItemsItem["InstanceSpec"].asString();
if(!dataNodeItemsItem["Currency"].isNull())
itemObject.currency = dataNodeItemsItem["Currency"].asString();
if(!dataNodeItemsItem["CoveragePercentage"].isNull())
itemObject.coveragePercentage = std::stof(dataNodeItemsItem["CoveragePercentage"].asString());
if(!dataNodeItemsItem["DeductAmount"].isNull())
itemObject.deductAmount = std::stof(dataNodeItemsItem["DeductAmount"].asString());
if(!dataNodeItemsItem["TotalAmount"].isNull())
itemObject.totalAmount = std::stof(dataNodeItemsItem["TotalAmount"].asString());
if(!dataNodeItemsItem["PostpaidCost"].isNull())
itemObject.postpaidCost = std::stof(dataNodeItemsItem["PostpaidCost"].asString());
if(!dataNodeItemsItem["StartPeriod"].isNull())
itemObject.startPeriod = dataNodeItemsItem["StartPeriod"].asString();
if(!dataNodeItemsItem["EndPeriod"].isNull())
itemObject.endPeriod = dataNodeItemsItem["EndPeriod"].asString();
data_.items.push_back(itemObject);
}
if(!value["Success"].isNull())
success_ = value["Success"].asString() == "true";
if(!value["Code"].isNull())
code_ = value["Code"].asString();
if(!value["Message"].isNull())
message_ = value["Message"].asString();
}
std::string DescribeSavingsPlansCoverageDetailResult::getMessage()const
{
return message_;
}
DescribeSavingsPlansCoverageDetailResult::Data DescribeSavingsPlansCoverageDetailResult::getData()const
{
return data_;
}
std::string DescribeSavingsPlansCoverageDetailResult::getCode()const
{
return code_;
}
bool DescribeSavingsPlansCoverageDetailResult::getSuccess()const
{
return success_;
}

View File

@@ -0,0 +1,73 @@
/*
* 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/bssopenapi/model/DescribeSavingsPlansCoverageTotalRequest.h>
using AlibabaCloud::BssOpenApi::Model::DescribeSavingsPlansCoverageTotalRequest;
DescribeSavingsPlansCoverageTotalRequest::DescribeSavingsPlansCoverageTotalRequest() :
RpcServiceRequest("bssopenapi", "2017-12-14", "DescribeSavingsPlansCoverageTotal")
{
setMethod(HttpRequest::Method::Post);
}
DescribeSavingsPlansCoverageTotalRequest::~DescribeSavingsPlansCoverageTotalRequest()
{}
std::string DescribeSavingsPlansCoverageTotalRequest::getPeriodType()const
{
return periodType_;
}
void DescribeSavingsPlansCoverageTotalRequest::setPeriodType(const std::string& periodType)
{
periodType_ = periodType;
setParameter("PeriodType", periodType);
}
long DescribeSavingsPlansCoverageTotalRequest::getBillOwnerId()const
{
return billOwnerId_;
}
void DescribeSavingsPlansCoverageTotalRequest::setBillOwnerId(long billOwnerId)
{
billOwnerId_ = billOwnerId;
setParameter("BillOwnerId", std::to_string(billOwnerId));
}
std::string DescribeSavingsPlansCoverageTotalRequest::getStartPeriod()const
{
return startPeriod_;
}
void DescribeSavingsPlansCoverageTotalRequest::setStartPeriod(const std::string& startPeriod)
{
startPeriod_ = startPeriod;
setParameter("StartPeriod", startPeriod);
}
std::string DescribeSavingsPlansCoverageTotalRequest::getEndPeriod()const
{
return endPeriod_;
}
void DescribeSavingsPlansCoverageTotalRequest::setEndPeriod(const std::string& endPeriod)
{
endPeriod_ = endPeriod;
setParameter("EndPeriod", endPeriod);
}

View File

@@ -0,0 +1,86 @@
/*
* 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/bssopenapi/model/DescribeSavingsPlansCoverageTotalResult.h>
#include <json/json.h>
using namespace AlibabaCloud::BssOpenApi;
using namespace AlibabaCloud::BssOpenApi::Model;
DescribeSavingsPlansCoverageTotalResult::DescribeSavingsPlansCoverageTotalResult() :
ServiceResult()
{}
DescribeSavingsPlansCoverageTotalResult::DescribeSavingsPlansCoverageTotalResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
DescribeSavingsPlansCoverageTotalResult::~DescribeSavingsPlansCoverageTotalResult()
{}
void DescribeSavingsPlansCoverageTotalResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto dataNode = value["Data"];
auto allPeriodCoverageNode = dataNode["PeriodCoverage"]["Item"];
for (auto dataNodePeriodCoverageItem : allPeriodCoverageNode)
{
Data::Item itemObject;
if(!dataNodePeriodCoverageItem["Period"].isNull())
itemObject.period = dataNodePeriodCoverageItem["Period"].asString();
if(!dataNodePeriodCoverageItem["Percentage"].isNull())
itemObject.percentage = std::stof(dataNodePeriodCoverageItem["Percentage"].asString());
data_.periodCoverage.push_back(itemObject);
}
auto totalCoverageNode = dataNode["TotalCoverage"];
if(!totalCoverageNode["CoveragePercentage"].isNull())
data_.totalCoverage.coveragePercentage = std::stof(totalCoverageNode["CoveragePercentage"].asString());
if(!totalCoverageNode["DeductAmount"].isNull())
data_.totalCoverage.deductAmount = std::stof(totalCoverageNode["DeductAmount"].asString());
if(!value["Success"].isNull())
success_ = value["Success"].asString() == "true";
if(!value["Code"].isNull())
code_ = value["Code"].asString();
if(!value["Message"].isNull())
message_ = value["Message"].asString();
}
std::string DescribeSavingsPlansCoverageTotalResult::getMessage()const
{
return message_;
}
DescribeSavingsPlansCoverageTotalResult::Data DescribeSavingsPlansCoverageTotalResult::getData()const
{
return data_;
}
std::string DescribeSavingsPlansCoverageTotalResult::getCode()const
{
return code_;
}
bool DescribeSavingsPlansCoverageTotalResult::getSuccess()const
{
return success_;
}

View File

@@ -0,0 +1,95 @@
/*
* 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/bssopenapi/model/DescribeSavingsPlansUsageDetailRequest.h>
using AlibabaCloud::BssOpenApi::Model::DescribeSavingsPlansUsageDetailRequest;
DescribeSavingsPlansUsageDetailRequest::DescribeSavingsPlansUsageDetailRequest() :
RpcServiceRequest("bssopenapi", "2017-12-14", "DescribeSavingsPlansUsageDetail")
{
setMethod(HttpRequest::Method::Post);
}
DescribeSavingsPlansUsageDetailRequest::~DescribeSavingsPlansUsageDetailRequest()
{}
std::string DescribeSavingsPlansUsageDetailRequest::getPeriodType()const
{
return periodType_;
}
void DescribeSavingsPlansUsageDetailRequest::setPeriodType(const std::string& periodType)
{
periodType_ = periodType;
setParameter("PeriodType", periodType);
}
long DescribeSavingsPlansUsageDetailRequest::getBillOwnerId()const
{
return billOwnerId_;
}
void DescribeSavingsPlansUsageDetailRequest::setBillOwnerId(long billOwnerId)
{
billOwnerId_ = billOwnerId;
setParameter("BillOwnerId", std::to_string(billOwnerId));
}
std::string DescribeSavingsPlansUsageDetailRequest::getStartPeriod()const
{
return startPeriod_;
}
void DescribeSavingsPlansUsageDetailRequest::setStartPeriod(const std::string& startPeriod)
{
startPeriod_ = startPeriod;
setParameter("StartPeriod", startPeriod);
}
std::string DescribeSavingsPlansUsageDetailRequest::getEndPeriod()const
{
return endPeriod_;
}
void DescribeSavingsPlansUsageDetailRequest::setEndPeriod(const std::string& endPeriod)
{
endPeriod_ = endPeriod;
setParameter("EndPeriod", endPeriod);
}
std::string DescribeSavingsPlansUsageDetailRequest::getToken()const
{
return token_;
}
void DescribeSavingsPlansUsageDetailRequest::setToken(const std::string& token)
{
token_ = token;
setParameter("Token", token);
}
int DescribeSavingsPlansUsageDetailRequest::getMaxResults()const
{
return maxResults_;
}
void DescribeSavingsPlansUsageDetailRequest::setMaxResults(int maxResults)
{
maxResults_ = maxResults;
setParameter("MaxResults", std::to_string(maxResults));
}

View File

@@ -0,0 +1,107 @@
/*
* 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/bssopenapi/model/DescribeSavingsPlansUsageDetailResult.h>
#include <json/json.h>
using namespace AlibabaCloud::BssOpenApi;
using namespace AlibabaCloud::BssOpenApi::Model;
DescribeSavingsPlansUsageDetailResult::DescribeSavingsPlansUsageDetailResult() :
ServiceResult()
{}
DescribeSavingsPlansUsageDetailResult::DescribeSavingsPlansUsageDetailResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
DescribeSavingsPlansUsageDetailResult::~DescribeSavingsPlansUsageDetailResult()
{}
void DescribeSavingsPlansUsageDetailResult::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["TotalCount"].isNull())
data_.totalCount = std::stoi(dataNode["TotalCount"].asString());
if(!dataNode["NextToken"].isNull())
data_.nextToken = dataNode["NextToken"].asString();
auto allItemsNode = dataNode["Items"]["Item"];
for (auto dataNodeItemsItem : allItemsNode)
{
Data::Item itemObject;
if(!dataNodeItemsItem["UserId"].isNull())
itemObject.userId = std::stol(dataNodeItemsItem["UserId"].asString());
if(!dataNodeItemsItem["UserName"].isNull())
itemObject.userName = dataNodeItemsItem["UserName"].asString();
if(!dataNodeItemsItem["InstanceId"].isNull())
itemObject.instanceId = dataNodeItemsItem["InstanceId"].asString();
if(!dataNodeItemsItem["StartPeriod"].isNull())
itemObject.startPeriod = dataNodeItemsItem["StartPeriod"].asString();
if(!dataNodeItemsItem["EndPeriod"].isNull())
itemObject.endPeriod = dataNodeItemsItem["EndPeriod"].asString();
if(!dataNodeItemsItem["Status"].isNull())
itemObject.status = dataNodeItemsItem["Status"].asString();
if(!dataNodeItemsItem["Type"].isNull())
itemObject.type = dataNodeItemsItem["Type"].asString();
if(!dataNodeItemsItem["UsagePercentage"].isNull())
itemObject.usagePercentage = std::stof(dataNodeItemsItem["UsagePercentage"].asString());
if(!dataNodeItemsItem["PoolValue"].isNull())
itemObject.poolValue = std::stof(dataNodeItemsItem["PoolValue"].asString());
if(!dataNodeItemsItem["DeductValue"].isNull())
itemObject.deductValue = std::stof(dataNodeItemsItem["DeductValue"].asString());
if(!dataNodeItemsItem["PostpaidCost"].isNull())
itemObject.postpaidCost = std::stof(dataNodeItemsItem["PostpaidCost"].asString());
if(!dataNodeItemsItem["SavedCost"].isNull())
itemObject.savedCost = std::stof(dataNodeItemsItem["SavedCost"].asString());
if(!dataNodeItemsItem["Currency"].isNull())
itemObject.currency = dataNodeItemsItem["Currency"].asString();
data_.items.push_back(itemObject);
}
if(!value["Success"].isNull())
success_ = value["Success"].asString() == "true";
if(!value["Code"].isNull())
code_ = value["Code"].asString();
if(!value["Message"].isNull())
message_ = value["Message"].asString();
}
std::string DescribeSavingsPlansUsageDetailResult::getMessage()const
{
return message_;
}
DescribeSavingsPlansUsageDetailResult::Data DescribeSavingsPlansUsageDetailResult::getData()const
{
return data_;
}
std::string DescribeSavingsPlansUsageDetailResult::getCode()const
{
return code_;
}
bool DescribeSavingsPlansUsageDetailResult::getSuccess()const
{
return success_;
}

View File

@@ -0,0 +1,73 @@
/*
* 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/bssopenapi/model/DescribeSavingsPlansUsageTotalRequest.h>
using AlibabaCloud::BssOpenApi::Model::DescribeSavingsPlansUsageTotalRequest;
DescribeSavingsPlansUsageTotalRequest::DescribeSavingsPlansUsageTotalRequest() :
RpcServiceRequest("bssopenapi", "2017-12-14", "DescribeSavingsPlansUsageTotal")
{
setMethod(HttpRequest::Method::Post);
}
DescribeSavingsPlansUsageTotalRequest::~DescribeSavingsPlansUsageTotalRequest()
{}
std::string DescribeSavingsPlansUsageTotalRequest::getPeriodType()const
{
return periodType_;
}
void DescribeSavingsPlansUsageTotalRequest::setPeriodType(const std::string& periodType)
{
periodType_ = periodType;
setParameter("PeriodType", periodType);
}
long DescribeSavingsPlansUsageTotalRequest::getBillOwnerId()const
{
return billOwnerId_;
}
void DescribeSavingsPlansUsageTotalRequest::setBillOwnerId(long billOwnerId)
{
billOwnerId_ = billOwnerId;
setParameter("BillOwnerId", std::to_string(billOwnerId));
}
std::string DescribeSavingsPlansUsageTotalRequest::getStartPeriod()const
{
return startPeriod_;
}
void DescribeSavingsPlansUsageTotalRequest::setStartPeriod(const std::string& startPeriod)
{
startPeriod_ = startPeriod;
setParameter("StartPeriod", startPeriod);
}
std::string DescribeSavingsPlansUsageTotalRequest::getEndPeriod()const
{
return endPeriod_;
}
void DescribeSavingsPlansUsageTotalRequest::setEndPeriod(const std::string& endPeriod)
{
endPeriod_ = endPeriod;
setParameter("EndPeriod", endPeriod);
}

View File

@@ -0,0 +1,90 @@
/*
* 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/bssopenapi/model/DescribeSavingsPlansUsageTotalResult.h>
#include <json/json.h>
using namespace AlibabaCloud::BssOpenApi;
using namespace AlibabaCloud::BssOpenApi::Model;
DescribeSavingsPlansUsageTotalResult::DescribeSavingsPlansUsageTotalResult() :
ServiceResult()
{}
DescribeSavingsPlansUsageTotalResult::DescribeSavingsPlansUsageTotalResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
DescribeSavingsPlansUsageTotalResult::~DescribeSavingsPlansUsageTotalResult()
{}
void DescribeSavingsPlansUsageTotalResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto dataNode = value["Data"];
auto allPeriodCoverageNode = dataNode["PeriodCoverage"]["Item"];
for (auto dataNodePeriodCoverageItem : allPeriodCoverageNode)
{
Data::Item itemObject;
if(!dataNodePeriodCoverageItem["Period"].isNull())
itemObject.period = dataNodePeriodCoverageItem["Period"].asString();
if(!dataNodePeriodCoverageItem["Percentage"].isNull())
itemObject.percentage = std::stof(dataNodePeriodCoverageItem["Percentage"].asString());
data_.periodCoverage.push_back(itemObject);
}
auto totalUsageNode = dataNode["TotalUsage"];
if(!totalUsageNode["UsagePercentage"].isNull())
data_.totalUsage.usagePercentage = std::stof(totalUsageNode["UsagePercentage"].asString());
if(!totalUsageNode["PostpaidCost"].isNull())
data_.totalUsage.postpaidCost = std::stof(totalUsageNode["PostpaidCost"].asString());
if(!totalUsageNode["PoolValue"].isNull())
data_.totalUsage.poolValue = std::stof(totalUsageNode["PoolValue"].asString());
if(!totalUsageNode["SavedCost"].isNull())
data_.totalUsage.savedCost = std::stof(totalUsageNode["SavedCost"].asString());
if(!value["Success"].isNull())
success_ = value["Success"].asString() == "true";
if(!value["Code"].isNull())
code_ = value["Code"].asString();
if(!value["Message"].isNull())
message_ = value["Message"].asString();
}
std::string DescribeSavingsPlansUsageTotalResult::getMessage()const
{
return message_;
}
DescribeSavingsPlansUsageTotalResult::Data DescribeSavingsPlansUsageTotalResult::getData()const
{
return data_;
}
std::string DescribeSavingsPlansUsageTotalResult::getCode()const
{
return code_;
}
bool DescribeSavingsPlansUsageTotalResult::getSuccess()const
{
return success_;
}

View File

@@ -60,6 +60,17 @@ void QueryDPUtilizationDetailRequest::setInstanceSpec(const std::string& instanc
setParameter("InstanceSpec", instanceSpec);
}
std::string QueryDPUtilizationDetailRequest::getProdCode()const
{
return prodCode_;
}
void QueryDPUtilizationDetailRequest::setProdCode(const std::string& prodCode)
{
prodCode_ = prodCode;
setParameter("ProdCode", prodCode);
}
std::string QueryDPUtilizationDetailRequest::getEndTime()const
{
return endTime_;