Generated 2015-01-01 for R-kvstore.
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
2020-04-09 Version: 1.36.343
|
||||
- Generated 2015-01-01 for `R-kvstore`.
|
||||
- Add DescribePrice API.
|
||||
|
||||
2020-04-08 Version: 1.36.342
|
||||
- Add SubCode for DescribeFaceVerify.
|
||||
|
||||
|
||||
@@ -83,6 +83,8 @@ set(r-kvstore_public_header_model
|
||||
include/alibabacloud/r-kvstore/model/DescribeMonitorItemsResult.h
|
||||
include/alibabacloud/r-kvstore/model/DescribeParametersRequest.h
|
||||
include/alibabacloud/r-kvstore/model/DescribeParametersResult.h
|
||||
include/alibabacloud/r-kvstore/model/DescribePriceRequest.h
|
||||
include/alibabacloud/r-kvstore/model/DescribePriceResult.h
|
||||
include/alibabacloud/r-kvstore/model/DescribeRegionsRequest.h
|
||||
include/alibabacloud/r-kvstore/model/DescribeRegionsResult.h
|
||||
include/alibabacloud/r-kvstore/model/DescribeRunningLogRecordsRequest.h
|
||||
@@ -234,6 +236,8 @@ set(r-kvstore_src
|
||||
src/model/DescribeMonitorItemsResult.cc
|
||||
src/model/DescribeParametersRequest.cc
|
||||
src/model/DescribeParametersResult.cc
|
||||
src/model/DescribePriceRequest.cc
|
||||
src/model/DescribePriceResult.cc
|
||||
src/model/DescribeRegionsRequest.cc
|
||||
src/model/DescribeRegionsResult.cc
|
||||
src/model/DescribeRunningLogRecordsRequest.cc
|
||||
|
||||
@@ -84,6 +84,8 @@
|
||||
#include "model/DescribeMonitorItemsResult.h"
|
||||
#include "model/DescribeParametersRequest.h"
|
||||
#include "model/DescribeParametersResult.h"
|
||||
#include "model/DescribePriceRequest.h"
|
||||
#include "model/DescribePriceResult.h"
|
||||
#include "model/DescribeRegionsRequest.h"
|
||||
#include "model/DescribeRegionsResult.h"
|
||||
#include "model/DescribeRunningLogRecordsRequest.h"
|
||||
@@ -272,6 +274,9 @@ namespace AlibabaCloud
|
||||
typedef Outcome<Error, Model::DescribeParametersResult> DescribeParametersOutcome;
|
||||
typedef std::future<DescribeParametersOutcome> DescribeParametersOutcomeCallable;
|
||||
typedef std::function<void(const R_kvstoreClient*, const Model::DescribeParametersRequest&, const DescribeParametersOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeParametersAsyncHandler;
|
||||
typedef Outcome<Error, Model::DescribePriceResult> DescribePriceOutcome;
|
||||
typedef std::future<DescribePriceOutcome> DescribePriceOutcomeCallable;
|
||||
typedef std::function<void(const R_kvstoreClient*, const Model::DescribePriceRequest&, const DescribePriceOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribePriceAsyncHandler;
|
||||
typedef Outcome<Error, Model::DescribeRegionsResult> DescribeRegionsOutcome;
|
||||
typedef std::future<DescribeRegionsOutcome> DescribeRegionsOutcomeCallable;
|
||||
typedef std::function<void(const R_kvstoreClient*, const Model::DescribeRegionsRequest&, const DescribeRegionsOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeRegionsAsyncHandler;
|
||||
@@ -499,6 +504,9 @@ namespace AlibabaCloud
|
||||
DescribeParametersOutcome describeParameters(const Model::DescribeParametersRequest &request)const;
|
||||
void describeParametersAsync(const Model::DescribeParametersRequest& request, const DescribeParametersAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
DescribeParametersOutcomeCallable describeParametersCallable(const Model::DescribeParametersRequest& request) const;
|
||||
DescribePriceOutcome describePrice(const Model::DescribePriceRequest &request)const;
|
||||
void describePriceAsync(const Model::DescribePriceRequest& request, const DescribePriceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
DescribePriceOutcomeCallable describePriceCallable(const Model::DescribePriceRequest& request) const;
|
||||
DescribeRegionsOutcome describeRegions(const Model::DescribeRegionsRequest &request)const;
|
||||
void describeRegionsAsync(const Model::DescribeRegionsRequest& request, const DescribeRegionsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
DescribeRegionsOutcomeCallable describeRegionsCallable(const Model::DescribeRegionsRequest& request) const;
|
||||
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_R_KVSTORE_MODEL_DESCRIBEPRICEREQUEST_H_
|
||||
#define ALIBABACLOUD_R_KVSTORE_MODEL_DESCRIBEPRICEREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/r-kvstore/R_kvstoreExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace R_kvstore
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_R_KVSTORE_EXPORT DescribePriceRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
DescribePriceRequest();
|
||||
~DescribePriceRequest();
|
||||
|
||||
long getResourceOwnerId()const;
|
||||
void setResourceOwnerId(long resourceOwnerId);
|
||||
std::string getNodeType()const;
|
||||
void setNodeType(const std::string& nodeType);
|
||||
std::string getInstances()const;
|
||||
void setInstances(const std::string& instances);
|
||||
std::string getCouponNo()const;
|
||||
void setCouponNo(const std::string& couponNo);
|
||||
std::string getInstanceClass()const;
|
||||
void setInstanceClass(const std::string& instanceClass);
|
||||
std::string getAccessKeyId()const;
|
||||
void setAccessKeyId(const std::string& accessKeyId);
|
||||
long getCapacity()const;
|
||||
void setCapacity(long capacity);
|
||||
std::string getSecurityToken()const;
|
||||
void setSecurityToken(const std::string& securityToken);
|
||||
std::string getBusinessInfo()const;
|
||||
void setBusinessInfo(const std::string& businessInfo);
|
||||
long getPeriod()const;
|
||||
void setPeriod(long period);
|
||||
long getQuantity()const;
|
||||
void setQuantity(long quantity);
|
||||
std::string getResourceOwnerAccount()const;
|
||||
void setResourceOwnerAccount(const std::string& resourceOwnerAccount);
|
||||
std::string getOwnerAccount()const;
|
||||
void setOwnerAccount(const std::string& ownerAccount);
|
||||
std::string getOrderParamOut()const;
|
||||
void setOrderParamOut(const std::string& orderParamOut);
|
||||
long getOwnerId()const;
|
||||
void setOwnerId(long ownerId);
|
||||
std::string getInstanceId()const;
|
||||
void setInstanceId(const std::string& instanceId);
|
||||
std::string getZoneId()const;
|
||||
void setZoneId(const std::string& zoneId);
|
||||
std::string getChargeType()const;
|
||||
void setChargeType(const std::string& chargeType);
|
||||
bool getForceUpgrade()const;
|
||||
void setForceUpgrade(bool forceUpgrade);
|
||||
std::string getOrderType()const;
|
||||
void setOrderType(const std::string& orderType);
|
||||
|
||||
private:
|
||||
long resourceOwnerId_;
|
||||
std::string nodeType_;
|
||||
std::string instances_;
|
||||
std::string couponNo_;
|
||||
std::string instanceClass_;
|
||||
std::string accessKeyId_;
|
||||
long capacity_;
|
||||
std::string securityToken_;
|
||||
std::string businessInfo_;
|
||||
long period_;
|
||||
long quantity_;
|
||||
std::string resourceOwnerAccount_;
|
||||
std::string ownerAccount_;
|
||||
std::string orderParamOut_;
|
||||
long ownerId_;
|
||||
std::string instanceId_;
|
||||
std::string zoneId_;
|
||||
std::string chargeType_;
|
||||
bool forceUpgrade_;
|
||||
std::string orderType_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_R_KVSTORE_MODEL_DESCRIBEPRICEREQUEST_H_
|
||||
@@ -0,0 +1,87 @@
|
||||
/*
|
||||
* 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_R_KVSTORE_MODEL_DESCRIBEPRICERESULT_H_
|
||||
#define ALIBABACLOUD_R_KVSTORE_MODEL_DESCRIBEPRICERESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/r-kvstore/R_kvstoreExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace R_kvstore
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_R_KVSTORE_EXPORT DescribePriceResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Order
|
||||
{
|
||||
struct Coupon
|
||||
{
|
||||
std::string couponNo;
|
||||
std::string description;
|
||||
std::string isSelected;
|
||||
std::string name;
|
||||
};
|
||||
std::vector<std::string> ruleIds1;
|
||||
std::string currency;
|
||||
float tradeAmount;
|
||||
std::vector<Coupon> coupons;
|
||||
float originalAmount;
|
||||
float discountAmount;
|
||||
};
|
||||
struct Rule
|
||||
{
|
||||
long ruleDescId;
|
||||
std::string title;
|
||||
std::string name;
|
||||
};
|
||||
struct SubOrder
|
||||
{
|
||||
std::string instanceId;
|
||||
std::vector<std::string> ruleIds;
|
||||
float tradeAmount;
|
||||
float originalAmount;
|
||||
float discountAmount;
|
||||
};
|
||||
|
||||
|
||||
DescribePriceResult();
|
||||
explicit DescribePriceResult(const std::string &payload);
|
||||
~DescribePriceResult();
|
||||
Order getOrder()const;
|
||||
std::vector<SubOrder> getSubOrders()const;
|
||||
std::string getOrderParams()const;
|
||||
std::vector<Rule> getRules()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
Order order_;
|
||||
std::vector<SubOrder> subOrders_;
|
||||
std::string orderParams_;
|
||||
std::vector<Rule> rules_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_R_KVSTORE_MODEL_DESCRIBEPRICERESULT_H_
|
||||
@@ -1167,6 +1167,42 @@ R_kvstoreClient::DescribeParametersOutcomeCallable R_kvstoreClient::describePara
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
R_kvstoreClient::DescribePriceOutcome R_kvstoreClient::describePrice(const DescribePriceRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return DescribePriceOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return DescribePriceOutcome(DescribePriceResult(outcome.result()));
|
||||
else
|
||||
return DescribePriceOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void R_kvstoreClient::describePriceAsync(const DescribePriceRequest& request, const DescribePriceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, describePrice(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
R_kvstoreClient::DescribePriceOutcomeCallable R_kvstoreClient::describePriceCallable(const DescribePriceRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<DescribePriceOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->describePrice(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
R_kvstoreClient::DescribeRegionsOutcome R_kvstoreClient::describeRegions(const DescribeRegionsRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
|
||||
249
r-kvstore/src/model/DescribePriceRequest.cc
Normal file
249
r-kvstore/src/model/DescribePriceRequest.cc
Normal file
@@ -0,0 +1,249 @@
|
||||
/*
|
||||
* 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/r-kvstore/model/DescribePriceRequest.h>
|
||||
|
||||
using AlibabaCloud::R_kvstore::Model::DescribePriceRequest;
|
||||
|
||||
DescribePriceRequest::DescribePriceRequest() :
|
||||
RpcServiceRequest("r-kvstore", "2015-01-01", "DescribePrice")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
DescribePriceRequest::~DescribePriceRequest()
|
||||
{}
|
||||
|
||||
long DescribePriceRequest::getResourceOwnerId()const
|
||||
{
|
||||
return resourceOwnerId_;
|
||||
}
|
||||
|
||||
void DescribePriceRequest::setResourceOwnerId(long resourceOwnerId)
|
||||
{
|
||||
resourceOwnerId_ = resourceOwnerId;
|
||||
setParameter("ResourceOwnerId", std::to_string(resourceOwnerId));
|
||||
}
|
||||
|
||||
std::string DescribePriceRequest::getNodeType()const
|
||||
{
|
||||
return nodeType_;
|
||||
}
|
||||
|
||||
void DescribePriceRequest::setNodeType(const std::string& nodeType)
|
||||
{
|
||||
nodeType_ = nodeType;
|
||||
setParameter("NodeType", nodeType);
|
||||
}
|
||||
|
||||
std::string DescribePriceRequest::getInstances()const
|
||||
{
|
||||
return instances_;
|
||||
}
|
||||
|
||||
void DescribePriceRequest::setInstances(const std::string& instances)
|
||||
{
|
||||
instances_ = instances;
|
||||
setParameter("Instances", instances);
|
||||
}
|
||||
|
||||
std::string DescribePriceRequest::getCouponNo()const
|
||||
{
|
||||
return couponNo_;
|
||||
}
|
||||
|
||||
void DescribePriceRequest::setCouponNo(const std::string& couponNo)
|
||||
{
|
||||
couponNo_ = couponNo;
|
||||
setParameter("CouponNo", couponNo);
|
||||
}
|
||||
|
||||
std::string DescribePriceRequest::getInstanceClass()const
|
||||
{
|
||||
return instanceClass_;
|
||||
}
|
||||
|
||||
void DescribePriceRequest::setInstanceClass(const std::string& instanceClass)
|
||||
{
|
||||
instanceClass_ = instanceClass;
|
||||
setParameter("InstanceClass", instanceClass);
|
||||
}
|
||||
|
||||
std::string DescribePriceRequest::getAccessKeyId()const
|
||||
{
|
||||
return accessKeyId_;
|
||||
}
|
||||
|
||||
void DescribePriceRequest::setAccessKeyId(const std::string& accessKeyId)
|
||||
{
|
||||
accessKeyId_ = accessKeyId;
|
||||
setParameter("AccessKeyId", accessKeyId);
|
||||
}
|
||||
|
||||
long DescribePriceRequest::getCapacity()const
|
||||
{
|
||||
return capacity_;
|
||||
}
|
||||
|
||||
void DescribePriceRequest::setCapacity(long capacity)
|
||||
{
|
||||
capacity_ = capacity;
|
||||
setParameter("Capacity", std::to_string(capacity));
|
||||
}
|
||||
|
||||
std::string DescribePriceRequest::getSecurityToken()const
|
||||
{
|
||||
return securityToken_;
|
||||
}
|
||||
|
||||
void DescribePriceRequest::setSecurityToken(const std::string& securityToken)
|
||||
{
|
||||
securityToken_ = securityToken;
|
||||
setParameter("SecurityToken", securityToken);
|
||||
}
|
||||
|
||||
std::string DescribePriceRequest::getBusinessInfo()const
|
||||
{
|
||||
return businessInfo_;
|
||||
}
|
||||
|
||||
void DescribePriceRequest::setBusinessInfo(const std::string& businessInfo)
|
||||
{
|
||||
businessInfo_ = businessInfo;
|
||||
setParameter("BusinessInfo", businessInfo);
|
||||
}
|
||||
|
||||
long DescribePriceRequest::getPeriod()const
|
||||
{
|
||||
return period_;
|
||||
}
|
||||
|
||||
void DescribePriceRequest::setPeriod(long period)
|
||||
{
|
||||
period_ = period;
|
||||
setParameter("Period", std::to_string(period));
|
||||
}
|
||||
|
||||
long DescribePriceRequest::getQuantity()const
|
||||
{
|
||||
return quantity_;
|
||||
}
|
||||
|
||||
void DescribePriceRequest::setQuantity(long quantity)
|
||||
{
|
||||
quantity_ = quantity;
|
||||
setParameter("Quantity", std::to_string(quantity));
|
||||
}
|
||||
|
||||
std::string DescribePriceRequest::getResourceOwnerAccount()const
|
||||
{
|
||||
return resourceOwnerAccount_;
|
||||
}
|
||||
|
||||
void DescribePriceRequest::setResourceOwnerAccount(const std::string& resourceOwnerAccount)
|
||||
{
|
||||
resourceOwnerAccount_ = resourceOwnerAccount;
|
||||
setParameter("ResourceOwnerAccount", resourceOwnerAccount);
|
||||
}
|
||||
|
||||
std::string DescribePriceRequest::getOwnerAccount()const
|
||||
{
|
||||
return ownerAccount_;
|
||||
}
|
||||
|
||||
void DescribePriceRequest::setOwnerAccount(const std::string& ownerAccount)
|
||||
{
|
||||
ownerAccount_ = ownerAccount;
|
||||
setParameter("OwnerAccount", ownerAccount);
|
||||
}
|
||||
|
||||
std::string DescribePriceRequest::getOrderParamOut()const
|
||||
{
|
||||
return orderParamOut_;
|
||||
}
|
||||
|
||||
void DescribePriceRequest::setOrderParamOut(const std::string& orderParamOut)
|
||||
{
|
||||
orderParamOut_ = orderParamOut;
|
||||
setParameter("OrderParamOut", orderParamOut);
|
||||
}
|
||||
|
||||
long DescribePriceRequest::getOwnerId()const
|
||||
{
|
||||
return ownerId_;
|
||||
}
|
||||
|
||||
void DescribePriceRequest::setOwnerId(long ownerId)
|
||||
{
|
||||
ownerId_ = ownerId;
|
||||
setParameter("OwnerId", std::to_string(ownerId));
|
||||
}
|
||||
|
||||
std::string DescribePriceRequest::getInstanceId()const
|
||||
{
|
||||
return instanceId_;
|
||||
}
|
||||
|
||||
void DescribePriceRequest::setInstanceId(const std::string& instanceId)
|
||||
{
|
||||
instanceId_ = instanceId;
|
||||
setParameter("InstanceId", instanceId);
|
||||
}
|
||||
|
||||
std::string DescribePriceRequest::getZoneId()const
|
||||
{
|
||||
return zoneId_;
|
||||
}
|
||||
|
||||
void DescribePriceRequest::setZoneId(const std::string& zoneId)
|
||||
{
|
||||
zoneId_ = zoneId;
|
||||
setParameter("ZoneId", zoneId);
|
||||
}
|
||||
|
||||
std::string DescribePriceRequest::getChargeType()const
|
||||
{
|
||||
return chargeType_;
|
||||
}
|
||||
|
||||
void DescribePriceRequest::setChargeType(const std::string& chargeType)
|
||||
{
|
||||
chargeType_ = chargeType;
|
||||
setParameter("ChargeType", chargeType);
|
||||
}
|
||||
|
||||
bool DescribePriceRequest::getForceUpgrade()const
|
||||
{
|
||||
return forceUpgrade_;
|
||||
}
|
||||
|
||||
void DescribePriceRequest::setForceUpgrade(bool forceUpgrade)
|
||||
{
|
||||
forceUpgrade_ = forceUpgrade;
|
||||
setParameter("ForceUpgrade", forceUpgrade ? "true" : "false");
|
||||
}
|
||||
|
||||
std::string DescribePriceRequest::getOrderType()const
|
||||
{
|
||||
return orderType_;
|
||||
}
|
||||
|
||||
void DescribePriceRequest::setOrderType(const std::string& orderType)
|
||||
{
|
||||
orderType_ = orderType;
|
||||
setParameter("OrderType", orderType);
|
||||
}
|
||||
|
||||
121
r-kvstore/src/model/DescribePriceResult.cc
Normal file
121
r-kvstore/src/model/DescribePriceResult.cc
Normal file
@@ -0,0 +1,121 @@
|
||||
/*
|
||||
* 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/r-kvstore/model/DescribePriceResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::R_kvstore;
|
||||
using namespace AlibabaCloud::R_kvstore::Model;
|
||||
|
||||
DescribePriceResult::DescribePriceResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
DescribePriceResult::DescribePriceResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
DescribePriceResult::~DescribePriceResult()
|
||||
{}
|
||||
|
||||
void DescribePriceResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto allRulesNode = value["Rules"]["Rule"];
|
||||
for (auto valueRulesRule : allRulesNode)
|
||||
{
|
||||
Rule rulesObject;
|
||||
if(!valueRulesRule["RuleDescId"].isNull())
|
||||
rulesObject.ruleDescId = std::stol(valueRulesRule["RuleDescId"].asString());
|
||||
if(!valueRulesRule["Name"].isNull())
|
||||
rulesObject.name = valueRulesRule["Name"].asString();
|
||||
if(!valueRulesRule["Title"].isNull())
|
||||
rulesObject.title = valueRulesRule["Title"].asString();
|
||||
rules_.push_back(rulesObject);
|
||||
}
|
||||
auto allSubOrdersNode = value["SubOrders"]["SubOrder"];
|
||||
for (auto valueSubOrdersSubOrder : allSubOrdersNode)
|
||||
{
|
||||
SubOrder subOrdersObject;
|
||||
if(!valueSubOrdersSubOrder["OriginalAmount"].isNull())
|
||||
subOrdersObject.originalAmount = std::stof(valueSubOrdersSubOrder["OriginalAmount"].asString());
|
||||
if(!valueSubOrdersSubOrder["TradeAmount"].isNull())
|
||||
subOrdersObject.tradeAmount = std::stof(valueSubOrdersSubOrder["TradeAmount"].asString());
|
||||
if(!valueSubOrdersSubOrder["DiscountAmount"].isNull())
|
||||
subOrdersObject.discountAmount = std::stof(valueSubOrdersSubOrder["DiscountAmount"].asString());
|
||||
if(!valueSubOrdersSubOrder["InstanceId"].isNull())
|
||||
subOrdersObject.instanceId = valueSubOrdersSubOrder["InstanceId"].asString();
|
||||
auto allRuleIds = value["RuleIds"]["RuleId"];
|
||||
for (auto value : allRuleIds)
|
||||
subOrdersObject.ruleIds.push_back(value.asString());
|
||||
subOrders_.push_back(subOrdersObject);
|
||||
}
|
||||
auto orderNode = value["Order"];
|
||||
if(!orderNode["OriginalAmount"].isNull())
|
||||
order_.originalAmount = std::stof(orderNode["OriginalAmount"].asString());
|
||||
if(!orderNode["TradeAmount"].isNull())
|
||||
order_.tradeAmount = std::stof(orderNode["TradeAmount"].asString());
|
||||
if(!orderNode["DiscountAmount"].isNull())
|
||||
order_.discountAmount = std::stof(orderNode["DiscountAmount"].asString());
|
||||
if(!orderNode["Currency"].isNull())
|
||||
order_.currency = orderNode["Currency"].asString();
|
||||
auto allCouponsNode = orderNode["Coupons"]["Coupon"];
|
||||
for (auto orderNodeCouponsCoupon : allCouponsNode)
|
||||
{
|
||||
Order::Coupon couponObject;
|
||||
if(!orderNodeCouponsCoupon["CouponNo"].isNull())
|
||||
couponObject.couponNo = orderNodeCouponsCoupon["CouponNo"].asString();
|
||||
if(!orderNodeCouponsCoupon["Name"].isNull())
|
||||
couponObject.name = orderNodeCouponsCoupon["Name"].asString();
|
||||
if(!orderNodeCouponsCoupon["Description"].isNull())
|
||||
couponObject.description = orderNodeCouponsCoupon["Description"].asString();
|
||||
if(!orderNodeCouponsCoupon["IsSelected"].isNull())
|
||||
couponObject.isSelected = orderNodeCouponsCoupon["IsSelected"].asString();
|
||||
order_.coupons.push_back(couponObject);
|
||||
}
|
||||
auto allRuleIds1 = orderNode["RuleIds"]["RuleId"];
|
||||
for (auto value : allRuleIds1)
|
||||
order_.ruleIds1.push_back(value.asString());
|
||||
if(!value["OrderParams"].isNull())
|
||||
orderParams_ = value["OrderParams"].asString();
|
||||
|
||||
}
|
||||
|
||||
DescribePriceResult::Order DescribePriceResult::getOrder()const
|
||||
{
|
||||
return order_;
|
||||
}
|
||||
|
||||
std::vector<DescribePriceResult::SubOrder> DescribePriceResult::getSubOrders()const
|
||||
{
|
||||
return subOrders_;
|
||||
}
|
||||
|
||||
std::string DescribePriceResult::getOrderParams()const
|
||||
{
|
||||
return orderParams_;
|
||||
}
|
||||
|
||||
std::vector<DescribePriceResult::Rule> DescribePriceResult::getRules()const
|
||||
{
|
||||
return rules_;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user