Fix bugs for DescribeDedicatedHosts.
This commit is contained in:
@@ -28,6 +28,10 @@ namespace Rds {
|
|||||||
namespace Model {
|
namespace Model {
|
||||||
class ALIBABACLOUD_RDS_EXPORT DescribePriceRequest : public RpcServiceRequest {
|
class ALIBABACLOUD_RDS_EXPORT DescribePriceRequest : public RpcServiceRequest {
|
||||||
public:
|
public:
|
||||||
|
struct ServerlessConfig {
|
||||||
|
double minCapacity;
|
||||||
|
double maxCapacity;
|
||||||
|
};
|
||||||
DescribePriceRequest();
|
DescribePriceRequest();
|
||||||
~DescribePriceRequest();
|
~DescribePriceRequest();
|
||||||
long getResourceOwnerId() const;
|
long getResourceOwnerId() const;
|
||||||
@@ -50,6 +54,8 @@ public:
|
|||||||
void setDBInstanceStorageType(const std::string &dBInstanceStorageType);
|
void setDBInstanceStorageType(const std::string &dBInstanceStorageType);
|
||||||
int getQuantity() const;
|
int getQuantity() const;
|
||||||
void setQuantity(int quantity);
|
void setQuantity(int quantity);
|
||||||
|
ServerlessConfig getServerlessConfig() const;
|
||||||
|
void setServerlessConfig(const ServerlessConfig &serverlessConfig);
|
||||||
std::string getResourceOwnerAccount() const;
|
std::string getResourceOwnerAccount() const;
|
||||||
void setResourceOwnerAccount(const std::string &resourceOwnerAccount);
|
void setResourceOwnerAccount(const std::string &resourceOwnerAccount);
|
||||||
std::string getOwnerAccount() const;
|
std::string getOwnerAccount() const;
|
||||||
@@ -86,6 +92,7 @@ private:
|
|||||||
std::string dBInstanceId_;
|
std::string dBInstanceId_;
|
||||||
std::string dBInstanceStorageType_;
|
std::string dBInstanceStorageType_;
|
||||||
int quantity_;
|
int quantity_;
|
||||||
|
ServerlessConfig serverlessConfig_;
|
||||||
std::string resourceOwnerAccount_;
|
std::string resourceOwnerAccount_;
|
||||||
std::string ownerAccount_;
|
std::string ownerAccount_;
|
||||||
std::string commodityCode_;
|
std::string commodityCode_;
|
||||||
|
|||||||
@@ -66,14 +66,18 @@ namespace AlibabaCloud
|
|||||||
DescribePriceResult();
|
DescribePriceResult();
|
||||||
explicit DescribePriceResult(const std::string &payload);
|
explicit DescribePriceResult(const std::string &payload);
|
||||||
~DescribePriceResult();
|
~DescribePriceResult();
|
||||||
|
float getTradeMinRCUAmount()const;
|
||||||
bool getShowDiscount()const;
|
bool getShowDiscount()const;
|
||||||
|
float getTradeMaxRCUAmount()const;
|
||||||
std::vector<Rule> getRules()const;
|
std::vector<Rule> getRules()const;
|
||||||
PriceInfo getPriceInfo()const;
|
PriceInfo getPriceInfo()const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void parse(const std::string &payload);
|
void parse(const std::string &payload);
|
||||||
private:
|
private:
|
||||||
|
float tradeMinRCUAmount_;
|
||||||
bool showDiscount_;
|
bool showDiscount_;
|
||||||
|
float tradeMaxRCUAmount_;
|
||||||
std::vector<Rule> rules_;
|
std::vector<Rule> rules_;
|
||||||
PriceInfo priceInfo_;
|
PriceInfo priceInfo_;
|
||||||
|
|
||||||
|
|||||||
@@ -115,6 +115,16 @@ void DescribePriceRequest::setQuantity(int quantity) {
|
|||||||
setParameter(std::string("Quantity"), std::to_string(quantity));
|
setParameter(std::string("Quantity"), std::to_string(quantity));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DescribePriceRequest::ServerlessConfig DescribePriceRequest::getServerlessConfig() const {
|
||||||
|
return serverlessConfig_;
|
||||||
|
}
|
||||||
|
|
||||||
|
void DescribePriceRequest::setServerlessConfig(const DescribePriceRequest::ServerlessConfig &serverlessConfig) {
|
||||||
|
serverlessConfig_ = serverlessConfig;
|
||||||
|
setParameter(std::string("ServerlessConfig") + ".MinCapacity", std::to_string(serverlessConfig.minCapacity));
|
||||||
|
setParameter(std::string("ServerlessConfig") + ".MaxCapacity", std::to_string(serverlessConfig.maxCapacity));
|
||||||
|
}
|
||||||
|
|
||||||
std::string DescribePriceRequest::getResourceOwnerAccount() const {
|
std::string DescribePriceRequest::getResourceOwnerAccount() const {
|
||||||
return resourceOwnerAccount_;
|
return resourceOwnerAccount_;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,14 +86,28 @@ void DescribePriceResult::parse(const std::string &payload)
|
|||||||
priceInfo_.ruleIds.push_back(value.asString());
|
priceInfo_.ruleIds.push_back(value.asString());
|
||||||
if(!value["ShowDiscount"].isNull())
|
if(!value["ShowDiscount"].isNull())
|
||||||
showDiscount_ = value["ShowDiscount"].asString() == "true";
|
showDiscount_ = value["ShowDiscount"].asString() == "true";
|
||||||
|
if(!value["TradeMaxRCUAmount"].isNull())
|
||||||
|
tradeMaxRCUAmount_ = std::stof(value["TradeMaxRCUAmount"].asString());
|
||||||
|
if(!value["TradeMinRCUAmount"].isNull())
|
||||||
|
tradeMinRCUAmount_ = std::stof(value["TradeMinRCUAmount"].asString());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float DescribePriceResult::getTradeMinRCUAmount()const
|
||||||
|
{
|
||||||
|
return tradeMinRCUAmount_;
|
||||||
|
}
|
||||||
|
|
||||||
bool DescribePriceResult::getShowDiscount()const
|
bool DescribePriceResult::getShowDiscount()const
|
||||||
{
|
{
|
||||||
return showDiscount_;
|
return showDiscount_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float DescribePriceResult::getTradeMaxRCUAmount()const
|
||||||
|
{
|
||||||
|
return tradeMaxRCUAmount_;
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<DescribePriceResult::Rule> DescribePriceResult::getRules()const
|
std::vector<DescribePriceResult::Rule> DescribePriceResult::getRules()const
|
||||||
{
|
{
|
||||||
return rules_;
|
return rules_;
|
||||||
|
|||||||
Reference in New Issue
Block a user