Support ServicePeriodUnit in QueryInstanceBill.
This commit is contained in:
@@ -1743,6 +1743,42 @@ BssOpenApiClient::QuerySettlementBillOutcomeCallable BssOpenApiClient::querySett
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
BssOpenApiClient::QuerySplitItemBillOutcome BssOpenApiClient::querySplitItemBill(const QuerySplitItemBillRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return QuerySplitItemBillOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return QuerySplitItemBillOutcome(QuerySplitItemBillResult(outcome.result()));
|
||||
else
|
||||
return QuerySplitItemBillOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void BssOpenApiClient::querySplitItemBillAsync(const QuerySplitItemBillRequest& request, const QuerySplitItemBillAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, querySplitItemBill(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
BssOpenApiClient::QuerySplitItemBillOutcomeCallable BssOpenApiClient::querySplitItemBillCallable(const QuerySplitItemBillRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<QuerySplitItemBillOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->querySplitItemBill(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
BssOpenApiClient::QueryUserOmsDataOutcome BssOpenApiClient::queryUserOmsData(const QueryUserOmsDataRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
|
||||
@@ -128,6 +128,8 @@ void QueryInstanceBillResult::parse(const std::string &payload)
|
||||
itemObject.servicePeriod = dataNodeItemsItem["ServicePeriod"].asString();
|
||||
if(!dataNodeItemsItem["BillingDate"].isNull())
|
||||
itemObject.billingDate = dataNodeItemsItem["BillingDate"].asString();
|
||||
if(!dataNodeItemsItem["ServicePeriodUnit"].isNull())
|
||||
itemObject.servicePeriodUnit = dataNodeItemsItem["ServicePeriodUnit"].asString();
|
||||
data_.items.push_back(itemObject);
|
||||
}
|
||||
if(!value["Success"].isNull())
|
||||
|
||||
106
bssopenapi/src/model/QuerySplitItemBillRequest.cc
Normal file
106
bssopenapi/src/model/QuerySplitItemBillRequest.cc
Normal file
@@ -0,0 +1,106 @@
|
||||
/*
|
||||
* 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/QuerySplitItemBillRequest.h>
|
||||
|
||||
using AlibabaCloud::BssOpenApi::Model::QuerySplitItemBillRequest;
|
||||
|
||||
QuerySplitItemBillRequest::QuerySplitItemBillRequest() :
|
||||
RpcServiceRequest("bssopenapi", "2017-12-14", "QuerySplitItemBill")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
QuerySplitItemBillRequest::~QuerySplitItemBillRequest()
|
||||
{}
|
||||
|
||||
std::string QuerySplitItemBillRequest::getProductCode()const
|
||||
{
|
||||
return productCode_;
|
||||
}
|
||||
|
||||
void QuerySplitItemBillRequest::setProductCode(const std::string& productCode)
|
||||
{
|
||||
productCode_ = productCode;
|
||||
setParameter("ProductCode", productCode);
|
||||
}
|
||||
|
||||
std::string QuerySplitItemBillRequest::getSubscriptionType()const
|
||||
{
|
||||
return subscriptionType_;
|
||||
}
|
||||
|
||||
void QuerySplitItemBillRequest::setSubscriptionType(const std::string& subscriptionType)
|
||||
{
|
||||
subscriptionType_ = subscriptionType;
|
||||
setParameter("SubscriptionType", subscriptionType);
|
||||
}
|
||||
|
||||
std::string QuerySplitItemBillRequest::getBillingCycle()const
|
||||
{
|
||||
return billingCycle_;
|
||||
}
|
||||
|
||||
void QuerySplitItemBillRequest::setBillingCycle(const std::string& billingCycle)
|
||||
{
|
||||
billingCycle_ = billingCycle;
|
||||
setParameter("BillingCycle", billingCycle);
|
||||
}
|
||||
|
||||
long QuerySplitItemBillRequest::getOwnerId()const
|
||||
{
|
||||
return ownerId_;
|
||||
}
|
||||
|
||||
void QuerySplitItemBillRequest::setOwnerId(long ownerId)
|
||||
{
|
||||
ownerId_ = ownerId;
|
||||
setParameter("OwnerId", std::to_string(ownerId));
|
||||
}
|
||||
|
||||
int QuerySplitItemBillRequest::getPageNum()const
|
||||
{
|
||||
return pageNum_;
|
||||
}
|
||||
|
||||
void QuerySplitItemBillRequest::setPageNum(int pageNum)
|
||||
{
|
||||
pageNum_ = pageNum;
|
||||
setParameter("PageNum", std::to_string(pageNum));
|
||||
}
|
||||
|
||||
std::string QuerySplitItemBillRequest::getProductType()const
|
||||
{
|
||||
return productType_;
|
||||
}
|
||||
|
||||
void QuerySplitItemBillRequest::setProductType(const std::string& productType)
|
||||
{
|
||||
productType_ = productType;
|
||||
setParameter("ProductType", productType);
|
||||
}
|
||||
|
||||
int QuerySplitItemBillRequest::getPageSize()const
|
||||
{
|
||||
return pageSize_;
|
||||
}
|
||||
|
||||
void QuerySplitItemBillRequest::setPageSize(int pageSize)
|
||||
{
|
||||
pageSize_ = pageSize;
|
||||
setParameter("PageSize", std::to_string(pageSize));
|
||||
}
|
||||
|
||||
165
bssopenapi/src/model/QuerySplitItemBillResult.cc
Normal file
165
bssopenapi/src/model/QuerySplitItemBillResult.cc
Normal file
@@ -0,0 +1,165 @@
|
||||
/*
|
||||
* 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/QuerySplitItemBillResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::BssOpenApi;
|
||||
using namespace AlibabaCloud::BssOpenApi::Model;
|
||||
|
||||
QuerySplitItemBillResult::QuerySplitItemBillResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
QuerySplitItemBillResult::QuerySplitItemBillResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
QuerySplitItemBillResult::~QuerySplitItemBillResult()
|
||||
{}
|
||||
|
||||
void QuerySplitItemBillResult::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["BillingCycle"].isNull())
|
||||
data_.billingCycle = dataNode["BillingCycle"].asString();
|
||||
if(!dataNode["AccountID"].isNull())
|
||||
data_.accountID = dataNode["AccountID"].asString();
|
||||
if(!dataNode["AccountName"].isNull())
|
||||
data_.accountName = dataNode["AccountName"].asString();
|
||||
if(!dataNode["TotalCount"].isNull())
|
||||
data_.totalCount = std::stoi(dataNode["TotalCount"].asString());
|
||||
if(!dataNode["PageNum"].isNull())
|
||||
data_.pageNum = std::stoi(dataNode["PageNum"].asString());
|
||||
if(!dataNode["PageSize"].isNull())
|
||||
data_.pageSize = std::stoi(dataNode["PageSize"].asString());
|
||||
auto allItemsNode = dataNode["Items"]["Item"];
|
||||
for (auto dataNodeItemsItem : allItemsNode)
|
||||
{
|
||||
Data::Item itemObject;
|
||||
if(!dataNodeItemsItem["InstanceID"].isNull())
|
||||
itemObject.instanceID = dataNodeItemsItem["InstanceID"].asString();
|
||||
if(!dataNodeItemsItem["BillingType"].isNull())
|
||||
itemObject.billingType = dataNodeItemsItem["BillingType"].asString();
|
||||
if(!dataNodeItemsItem["CostUnit"].isNull())
|
||||
itemObject.costUnit = dataNodeItemsItem["CostUnit"].asString();
|
||||
if(!dataNodeItemsItem["ProductCode"].isNull())
|
||||
itemObject.productCode = dataNodeItemsItem["ProductCode"].asString();
|
||||
if(!dataNodeItemsItem["ProductType"].isNull())
|
||||
itemObject.productType = dataNodeItemsItem["ProductType"].asString();
|
||||
if(!dataNodeItemsItem["SubscriptionType"].isNull())
|
||||
itemObject.subscriptionType = dataNodeItemsItem["SubscriptionType"].asString();
|
||||
if(!dataNodeItemsItem["ProductName"].isNull())
|
||||
itemObject.productName = dataNodeItemsItem["ProductName"].asString();
|
||||
if(!dataNodeItemsItem["ProductDetail"].isNull())
|
||||
itemObject.productDetail = dataNodeItemsItem["ProductDetail"].asString();
|
||||
if(!dataNodeItemsItem["OwnerID"].isNull())
|
||||
itemObject.ownerID = dataNodeItemsItem["OwnerID"].asString();
|
||||
if(!dataNodeItemsItem["BillingItem"].isNull())
|
||||
itemObject.billingItem = dataNodeItemsItem["BillingItem"].asString();
|
||||
if(!dataNodeItemsItem["ListPrice"].isNull())
|
||||
itemObject.listPrice = dataNodeItemsItem["ListPrice"].asString();
|
||||
if(!dataNodeItemsItem["ListPriceUnit"].isNull())
|
||||
itemObject.listPriceUnit = dataNodeItemsItem["ListPriceUnit"].asString();
|
||||
if(!dataNodeItemsItem["Usage"].isNull())
|
||||
itemObject.usage = dataNodeItemsItem["Usage"].asString();
|
||||
if(!dataNodeItemsItem["UsageUnit"].isNull())
|
||||
itemObject.usageUnit = dataNodeItemsItem["UsageUnit"].asString();
|
||||
if(!dataNodeItemsItem["DeductedByResourcePackage"].isNull())
|
||||
itemObject.deductedByResourcePackage = dataNodeItemsItem["DeductedByResourcePackage"].asString();
|
||||
if(!dataNodeItemsItem["PretaxGrossAmount"].isNull())
|
||||
itemObject.pretaxGrossAmount = std::stof(dataNodeItemsItem["PretaxGrossAmount"].asString());
|
||||
if(!dataNodeItemsItem["InvoiceDiscount"].isNull())
|
||||
itemObject.invoiceDiscount = std::stof(dataNodeItemsItem["InvoiceDiscount"].asString());
|
||||
if(!dataNodeItemsItem["DeductedByCoupons"].isNull())
|
||||
itemObject.deductedByCoupons = std::stof(dataNodeItemsItem["DeductedByCoupons"].asString());
|
||||
if(!dataNodeItemsItem["PretaxAmount"].isNull())
|
||||
itemObject.pretaxAmount = std::stof(dataNodeItemsItem["PretaxAmount"].asString());
|
||||
if(!dataNodeItemsItem["DeductedByCashCoupons"].isNull())
|
||||
itemObject.deductedByCashCoupons = std::stof(dataNodeItemsItem["DeductedByCashCoupons"].asString());
|
||||
if(!dataNodeItemsItem["DeductedByPrepaidCard"].isNull())
|
||||
itemObject.deductedByPrepaidCard = std::stof(dataNodeItemsItem["DeductedByPrepaidCard"].asString());
|
||||
if(!dataNodeItemsItem["PaymentAmount"].isNull())
|
||||
itemObject.paymentAmount = std::stof(dataNodeItemsItem["PaymentAmount"].asString());
|
||||
if(!dataNodeItemsItem["OutstandingAmount"].isNull())
|
||||
itemObject.outstandingAmount = std::stof(dataNodeItemsItem["OutstandingAmount"].asString());
|
||||
if(!dataNodeItemsItem["Currency"].isNull())
|
||||
itemObject.currency = dataNodeItemsItem["Currency"].asString();
|
||||
if(!dataNodeItemsItem["NickName"].isNull())
|
||||
itemObject.nickName = dataNodeItemsItem["NickName"].asString();
|
||||
if(!dataNodeItemsItem["ResourceGroup"].isNull())
|
||||
itemObject.resourceGroup = dataNodeItemsItem["ResourceGroup"].asString();
|
||||
if(!dataNodeItemsItem["Tag"].isNull())
|
||||
itemObject.tag = dataNodeItemsItem["Tag"].asString();
|
||||
if(!dataNodeItemsItem["InstanceConfig"].isNull())
|
||||
itemObject.instanceConfig = dataNodeItemsItem["InstanceConfig"].asString();
|
||||
if(!dataNodeItemsItem["InstanceSpec"].isNull())
|
||||
itemObject.instanceSpec = dataNodeItemsItem["InstanceSpec"].asString();
|
||||
if(!dataNodeItemsItem["InternetIP"].isNull())
|
||||
itemObject.internetIP = dataNodeItemsItem["InternetIP"].asString();
|
||||
if(!dataNodeItemsItem["IntranetIP"].isNull())
|
||||
itemObject.intranetIP = dataNodeItemsItem["IntranetIP"].asString();
|
||||
if(!dataNodeItemsItem["Region"].isNull())
|
||||
itemObject.region = dataNodeItemsItem["Region"].asString();
|
||||
if(!dataNodeItemsItem["Zone"].isNull())
|
||||
itemObject.zone = dataNodeItemsItem["Zone"].asString();
|
||||
if(!dataNodeItemsItem["Item"].isNull())
|
||||
itemObject.item = dataNodeItemsItem["Item"].asString();
|
||||
if(!dataNodeItemsItem["ServicePeriod"].isNull())
|
||||
itemObject.servicePeriod = dataNodeItemsItem["ServicePeriod"].asString();
|
||||
if(!dataNodeItemsItem["BillingDate"].isNull())
|
||||
itemObject.billingDate = dataNodeItemsItem["BillingDate"].asString();
|
||||
if(!dataNodeItemsItem["SplitItemID"].isNull())
|
||||
itemObject.splitItemID = dataNodeItemsItem["SplitItemID"].asString();
|
||||
if(!dataNodeItemsItem["SplitItemName"].isNull())
|
||||
itemObject.splitItemName = dataNodeItemsItem["SplitItemName"].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 QuerySplitItemBillResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
QuerySplitItemBillResult::Data QuerySplitItemBillResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
std::string QuerySplitItemBillResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
bool QuerySplitItemBillResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ using AlibabaCloud::BssOpenApi::Model::QueryUserOmsDataRequest;
|
||||
QueryUserOmsDataRequest::QueryUserOmsDataRequest() :
|
||||
RpcServiceRequest("bssopenapi", "2017-12-14", "QueryUserOmsData")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Get);
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
QueryUserOmsDataRequest::~QueryUserOmsDataRequest()
|
||||
|
||||
Reference in New Issue
Block a user