EHPC SDK Auto Released By qianzheng.llc,Version:1.25.0

Signed-off-by: yixiong.jxy <yixiong.jxy@alibaba-inc.com>
This commit is contained in:
yixiong.jxy
2018-09-05 10:48:44 +08:00
parent 19a082eb56
commit e96ffc6afe
13 changed files with 703 additions and 1 deletions

View File

@@ -1,3 +1,6 @@
2018-09-05 Version: 1.25.0
1, Add new APIs with control policy for querying price
2018-09-03 Version: 1.24.2
1, voice identify interface
2, client upload credentials interface

View File

@@ -1 +1 @@
1.24.2
1.25.0

View File

@@ -53,6 +53,8 @@ set(ehpc_public_header_model
include/alibabacloud/ehpc/model/StartNodesResult.h
include/alibabacloud/ehpc/model/GetCloudMetricProfilingRequest.h
include/alibabacloud/ehpc/model/GetCloudMetricProfilingResult.h
include/alibabacloud/ehpc/model/DescribeImagePriceRequest.h
include/alibabacloud/ehpc/model/DescribeImagePriceResult.h
include/alibabacloud/ehpc/model/GetAutoScaleConfigRequest.h
include/alibabacloud/ehpc/model/GetAutoScaleConfigResult.h
include/alibabacloud/ehpc/model/ListNodesRequest.h
@@ -135,6 +137,8 @@ set(ehpc_public_header_model
include/alibabacloud/ehpc/model/DescribeAutoScaleConfigResult.h
include/alibabacloud/ehpc/model/RunCloudMetricProfilingRequest.h
include/alibabacloud/ehpc/model/RunCloudMetricProfilingResult.h
include/alibabacloud/ehpc/model/DescribePriceRequest.h
include/alibabacloud/ehpc/model/DescribePriceResult.h
include/alibabacloud/ehpc/model/RerunJobsRequest.h
include/alibabacloud/ehpc/model/RerunJobsResult.h
include/alibabacloud/ehpc/model/EditJobTemplateRequest.h
@@ -184,6 +188,8 @@ set(ehpc_src
src/model/StartNodesResult.cc
src/model/GetCloudMetricProfilingRequest.cc
src/model/GetCloudMetricProfilingResult.cc
src/model/DescribeImagePriceRequest.cc
src/model/DescribeImagePriceResult.cc
src/model/GetAutoScaleConfigRequest.cc
src/model/GetAutoScaleConfigResult.cc
src/model/ListNodesRequest.cc
@@ -266,6 +272,8 @@ set(ehpc_src
src/model/DescribeAutoScaleConfigResult.cc
src/model/RunCloudMetricProfilingRequest.cc
src/model/RunCloudMetricProfilingResult.cc
src/model/DescribePriceRequest.cc
src/model/DescribePriceResult.cc
src/model/RerunJobsRequest.cc
src/model/RerunJobsResult.cc
src/model/EditJobTemplateRequest.cc

View File

@@ -54,6 +54,8 @@
#include "model/StartNodesResult.h"
#include "model/GetCloudMetricProfilingRequest.h"
#include "model/GetCloudMetricProfilingResult.h"
#include "model/DescribeImagePriceRequest.h"
#include "model/DescribeImagePriceResult.h"
#include "model/GetAutoScaleConfigRequest.h"
#include "model/GetAutoScaleConfigResult.h"
#include "model/ListNodesRequest.h"
@@ -136,6 +138,8 @@
#include "model/DescribeAutoScaleConfigResult.h"
#include "model/RunCloudMetricProfilingRequest.h"
#include "model/RunCloudMetricProfilingResult.h"
#include "model/DescribePriceRequest.h"
#include "model/DescribePriceResult.h"
#include "model/RerunJobsRequest.h"
#include "model/RerunJobsResult.h"
#include "model/EditJobTemplateRequest.h"
@@ -207,6 +211,9 @@ namespace AlibabaCloud
typedef Outcome<Error, Model::GetCloudMetricProfilingResult> GetCloudMetricProfilingOutcome;
typedef std::future<GetCloudMetricProfilingOutcome> GetCloudMetricProfilingOutcomeCallable;
typedef std::function<void(const EHPCClient*, const Model::GetCloudMetricProfilingRequest&, const GetCloudMetricProfilingOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetCloudMetricProfilingAsyncHandler;
typedef Outcome<Error, Model::DescribeImagePriceResult> DescribeImagePriceOutcome;
typedef std::future<DescribeImagePriceOutcome> DescribeImagePriceOutcomeCallable;
typedef std::function<void(const EHPCClient*, const Model::DescribeImagePriceRequest&, const DescribeImagePriceOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeImagePriceAsyncHandler;
typedef Outcome<Error, Model::GetAutoScaleConfigResult> GetAutoScaleConfigOutcome;
typedef std::future<GetAutoScaleConfigOutcome> GetAutoScaleConfigOutcomeCallable;
typedef std::function<void(const EHPCClient*, const Model::GetAutoScaleConfigRequest&, const GetAutoScaleConfigOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetAutoScaleConfigAsyncHandler;
@@ -330,6 +337,9 @@ namespace AlibabaCloud
typedef Outcome<Error, Model::RunCloudMetricProfilingResult> RunCloudMetricProfilingOutcome;
typedef std::future<RunCloudMetricProfilingOutcome> RunCloudMetricProfilingOutcomeCallable;
typedef std::function<void(const EHPCClient*, const Model::RunCloudMetricProfilingRequest&, const RunCloudMetricProfilingOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RunCloudMetricProfilingAsyncHandler;
typedef Outcome<Error, Model::DescribePriceResult> DescribePriceOutcome;
typedef std::future<DescribePriceOutcome> DescribePriceOutcomeCallable;
typedef std::function<void(const EHPCClient*, const Model::DescribePriceRequest&, const DescribePriceOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribePriceAsyncHandler;
typedef Outcome<Error, Model::RerunJobsResult> RerunJobsOutcome;
typedef std::future<RerunJobsOutcome> RerunJobsOutcomeCallable;
typedef std::function<void(const EHPCClient*, const Model::RerunJobsRequest&, const RerunJobsOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RerunJobsAsyncHandler;
@@ -404,6 +414,9 @@ namespace AlibabaCloud
GetCloudMetricProfilingOutcome getCloudMetricProfiling(const Model::GetCloudMetricProfilingRequest &request)const;
void getCloudMetricProfilingAsync(const Model::GetCloudMetricProfilingRequest& request, const GetCloudMetricProfilingAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
GetCloudMetricProfilingOutcomeCallable getCloudMetricProfilingCallable(const Model::GetCloudMetricProfilingRequest& request) const;
DescribeImagePriceOutcome describeImagePrice(const Model::DescribeImagePriceRequest &request)const;
void describeImagePriceAsync(const Model::DescribeImagePriceRequest& request, const DescribeImagePriceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
DescribeImagePriceOutcomeCallable describeImagePriceCallable(const Model::DescribeImagePriceRequest& request) const;
GetAutoScaleConfigOutcome getAutoScaleConfig(const Model::GetAutoScaleConfigRequest &request)const;
void getAutoScaleConfigAsync(const Model::GetAutoScaleConfigRequest& request, const GetAutoScaleConfigAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
GetAutoScaleConfigOutcomeCallable getAutoScaleConfigCallable(const Model::GetAutoScaleConfigRequest& request) const;
@@ -527,6 +540,9 @@ namespace AlibabaCloud
RunCloudMetricProfilingOutcome runCloudMetricProfiling(const Model::RunCloudMetricProfilingRequest &request)const;
void runCloudMetricProfilingAsync(const Model::RunCloudMetricProfilingRequest& request, const RunCloudMetricProfilingAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
RunCloudMetricProfilingOutcomeCallable runCloudMetricProfilingCallable(const Model::RunCloudMetricProfilingRequest& 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;
RerunJobsOutcome rerunJobs(const Model::RerunJobsRequest &request)const;
void rerunJobsAsync(const Model::RerunJobsRequest& request, const RerunJobsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
RerunJobsOutcomeCallable rerunJobsCallable(const Model::RerunJobsRequest& request) const;

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.
*/
#ifndef ALIBABACLOUD_EHPC_MODEL_DESCRIBEIMAGEPRICEREQUEST_H_
#define ALIBABACLOUD_EHPC_MODEL_DESCRIBEIMAGEPRICEREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/ehpc/EHPCExport.h>
namespace AlibabaCloud
{
namespace EHPC
{
namespace Model
{
class ALIBABACLOUD_EHPC_EXPORT DescribeImagePriceRequest : public RpcServiceRequest
{
public:
DescribeImagePriceRequest();
~DescribeImagePriceRequest();
int getPeriod()const;
void setPeriod(int period);
int getAmount()const;
void setAmount(int amount);
std::string getImageId()const;
void setImageId(const std::string& imageId);
std::string getPriceUnit()const;
void setPriceUnit(const std::string& priceUnit);
std::string getSkuCode()const;
void setSkuCode(const std::string& skuCode);
std::string getAccessKeyId()const;
void setAccessKeyId(const std::string& accessKeyId);
std::string getOrderType()const;
void setOrderType(const std::string& orderType);
private:
int period_;
int amount_;
std::string imageId_;
std::string priceUnit_;
std::string skuCode_;
std::string accessKeyId_;
std::string orderType_;
};
}
}
}
#endif // !ALIBABACLOUD_EHPC_MODEL_DESCRIBEIMAGEPRICEREQUEST_H_

View File

@@ -0,0 +1,59 @@
/*
* 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_EHPC_MODEL_DESCRIBEIMAGEPRICERESULT_H_
#define ALIBABACLOUD_EHPC_MODEL_DESCRIBEIMAGEPRICERESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/ehpc/EHPCExport.h>
namespace AlibabaCloud
{
namespace EHPC
{
namespace Model
{
class ALIBABACLOUD_EHPC_EXPORT DescribeImagePriceResult : public ServiceResult
{
public:
DescribeImagePriceResult();
explicit DescribeImagePriceResult(const std::string &payload);
~DescribeImagePriceResult();
float getOriginalPrice()const;
float getDiscountPrice()const;
int getAmount()const;
std::string getImageId()const;
float getTradePrice()const;
protected:
void parse(const std::string &payload);
private:
float originalPrice_;
float discountPrice_;
int amount_;
std::string imageId_;
float tradePrice_;
};
}
}
}
#endif // !ALIBABACLOUD_EHPC_MODEL_DESCRIBEIMAGEPRICERESULT_H_

View File

@@ -0,0 +1,70 @@
/*
* 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_EHPC_MODEL_DESCRIBEPRICEREQUEST_H_
#define ALIBABACLOUD_EHPC_MODEL_DESCRIBEPRICEREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/ehpc/EHPCExport.h>
namespace AlibabaCloud
{
namespace EHPC
{
namespace Model
{
class ALIBABACLOUD_EHPC_EXPORT DescribePriceRequest : public RpcServiceRequest
{
struct Commodities
{
int amount;
int period;
std::string nodeType;
std::string systemDiskCategory;
int systemDiskSize;
std::string instanceType;
std::string networkType;
};
public:
DescribePriceRequest();
~DescribePriceRequest();
std::string getPriceUnit()const;
void setPriceUnit(const std::string& priceUnit);
std::vector<Commodities> getCommodities()const;
void setCommodities(const std::vector<Commodities>& commodities);
std::string getChargeType()const;
void setChargeType(const std::string& chargeType);
std::string getAccessKeyId()const;
void setAccessKeyId(const std::string& accessKeyId);
std::string getOrderType()const;
void setOrderType(const std::string& orderType);
private:
std::string priceUnit_;
std::vector<Commodities> commodities_;
std::string chargeType_;
std::string accessKeyId_;
std::string orderType_;
};
}
}
}
#endif // !ALIBABACLOUD_EHPC_MODEL_DESCRIBEPRICEREQUEST_H_

View File

@@ -0,0 +1,60 @@
/*
* 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_EHPC_MODEL_DESCRIBEPRICERESULT_H_
#define ALIBABACLOUD_EHPC_MODEL_DESCRIBEPRICERESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/ehpc/EHPCExport.h>
namespace AlibabaCloud
{
namespace EHPC
{
namespace Model
{
class ALIBABACLOUD_EHPC_EXPORT DescribePriceResult : public ServiceResult
{
public:
struct PriceInfo
{
float originalPrice;
std::string nodeType;
std::string currency;
float tradePrice;
};
DescribePriceResult();
explicit DescribePriceResult(const std::string &payload);
~DescribePriceResult();
std::vector<PriceInfo> getPrices()const;
float getTotalTradePrice()const;
protected:
void parse(const std::string &payload);
private:
std::vector<PriceInfo> prices_;
float totalTradePrice_;
};
}
}
}
#endif // !ALIBABACLOUD_EHPC_MODEL_DESCRIBEPRICERESULT_H_

View File

@@ -627,6 +627,42 @@ EHPCClient::GetCloudMetricProfilingOutcomeCallable EHPCClient::getCloudMetricPro
return task->get_future();
}
EHPCClient::DescribeImagePriceOutcome EHPCClient::describeImagePrice(const DescribeImagePriceRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return DescribeImagePriceOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return DescribeImagePriceOutcome(DescribeImagePriceResult(outcome.result()));
else
return DescribeImagePriceOutcome(outcome.error());
}
void EHPCClient::describeImagePriceAsync(const DescribeImagePriceRequest& request, const DescribeImagePriceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, describeImagePrice(request), context);
};
asyncExecute(new Runnable(fn));
}
EHPCClient::DescribeImagePriceOutcomeCallable EHPCClient::describeImagePriceCallable(const DescribeImagePriceRequest &request) const
{
auto task = std::make_shared<std::packaged_task<DescribeImagePriceOutcome()>>(
[this, request]()
{
return this->describeImagePrice(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
EHPCClient::GetAutoScaleConfigOutcome EHPCClient::getAutoScaleConfig(const GetAutoScaleConfigRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -2103,6 +2139,42 @@ EHPCClient::RunCloudMetricProfilingOutcomeCallable EHPCClient::runCloudMetricPro
return task->get_future();
}
EHPCClient::DescribePriceOutcome EHPCClient::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 EHPCClient::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));
}
EHPCClient::DescribePriceOutcomeCallable EHPCClient::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();
}
EHPCClient::RerunJobsOutcome EHPCClient::rerunJobs(const RerunJobsRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();

View File

@@ -0,0 +1,104 @@
/*
* 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/ehpc/model/DescribeImagePriceRequest.h>
using AlibabaCloud::EHPC::Model::DescribeImagePriceRequest;
DescribeImagePriceRequest::DescribeImagePriceRequest() :
RpcServiceRequest("ehpc", "2018-04-12", "DescribeImagePrice")
{}
DescribeImagePriceRequest::~DescribeImagePriceRequest()
{}
int DescribeImagePriceRequest::getPeriod()const
{
return period_;
}
void DescribeImagePriceRequest::setPeriod(int period)
{
period_ = period;
setParameter("Period", std::to_string(period));
}
int DescribeImagePriceRequest::getAmount()const
{
return amount_;
}
void DescribeImagePriceRequest::setAmount(int amount)
{
amount_ = amount;
setParameter("Amount", std::to_string(amount));
}
std::string DescribeImagePriceRequest::getImageId()const
{
return imageId_;
}
void DescribeImagePriceRequest::setImageId(const std::string& imageId)
{
imageId_ = imageId;
setParameter("ImageId", imageId);
}
std::string DescribeImagePriceRequest::getPriceUnit()const
{
return priceUnit_;
}
void DescribeImagePriceRequest::setPriceUnit(const std::string& priceUnit)
{
priceUnit_ = priceUnit;
setParameter("PriceUnit", priceUnit);
}
std::string DescribeImagePriceRequest::getSkuCode()const
{
return skuCode_;
}
void DescribeImagePriceRequest::setSkuCode(const std::string& skuCode)
{
skuCode_ = skuCode;
setParameter("SkuCode", skuCode);
}
std::string DescribeImagePriceRequest::getAccessKeyId()const
{
return accessKeyId_;
}
void DescribeImagePriceRequest::setAccessKeyId(const std::string& accessKeyId)
{
accessKeyId_ = accessKeyId;
setParameter("AccessKeyId", accessKeyId);
}
std::string DescribeImagePriceRequest::getOrderType()const
{
return orderType_;
}
void DescribeImagePriceRequest::setOrderType(const std::string& orderType)
{
orderType_ = orderType;
setParameter("OrderType", orderType);
}

View File

@@ -0,0 +1,80 @@
/*
* 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/ehpc/model/DescribeImagePriceResult.h>
#include <json/json.h>
using namespace AlibabaCloud::EHPC;
using namespace AlibabaCloud::EHPC::Model;
DescribeImagePriceResult::DescribeImagePriceResult() :
ServiceResult()
{}
DescribeImagePriceResult::DescribeImagePriceResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
DescribeImagePriceResult::~DescribeImagePriceResult()
{}
void DescribeImagePriceResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
if(!value["ImageId"].isNull())
imageId_ = value["ImageId"].asString();
if(!value["DiscountPrice"].isNull())
discountPrice_ = std::stof(value["DiscountPrice"].asString());
if(!value["OriginalPrice"].isNull())
originalPrice_ = std::stof(value["OriginalPrice"].asString());
if(!value["TradePrice"].isNull())
tradePrice_ = std::stof(value["TradePrice"].asString());
if(!value["Amount"].isNull())
amount_ = std::stoi(value["Amount"].asString());
}
float DescribeImagePriceResult::getOriginalPrice()const
{
return originalPrice_;
}
float DescribeImagePriceResult::getDiscountPrice()const
{
return discountPrice_;
}
int DescribeImagePriceResult::getAmount()const
{
return amount_;
}
std::string DescribeImagePriceResult::getImageId()const
{
return imageId_;
}
float DescribeImagePriceResult::getTradePrice()const
{
return tradePrice_;
}

View File

@@ -0,0 +1,93 @@
/*
* 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/ehpc/model/DescribePriceRequest.h>
using AlibabaCloud::EHPC::Model::DescribePriceRequest;
DescribePriceRequest::DescribePriceRequest() :
RpcServiceRequest("ehpc", "2018-04-12", "DescribePrice")
{}
DescribePriceRequest::~DescribePriceRequest()
{}
std::string DescribePriceRequest::getPriceUnit()const
{
return priceUnit_;
}
void DescribePriceRequest::setPriceUnit(const std::string& priceUnit)
{
priceUnit_ = priceUnit;
setParameter("PriceUnit", priceUnit);
}
std::vector<DescribePriceRequest::Commodities> DescribePriceRequest::getCommodities()const
{
return commodities_;
}
void DescribePriceRequest::setCommodities(const std::vector<Commodities>& commodities)
{
commodities_ = commodities;
int i = 0;
for(int i = 0; i!= commodities.size(); i++) {
auto obj = commodities.at(i);
std::string str ="Commodities."+ std::to_string(i);
setParameter(str + ".Amount", std::to_string(obj.amount));
setParameter(str + ".Period", std::to_string(obj.period));
setParameter(str + ".NodeType", obj.nodeType);
setParameter(str + ".SystemDiskCategory", obj.systemDiskCategory);
setParameter(str + ".SystemDiskSize", std::to_string(obj.systemDiskSize));
setParameter(str + ".InstanceType", obj.instanceType);
setParameter(str + ".NetworkType", obj.networkType);
}
}
std::string DescribePriceRequest::getChargeType()const
{
return chargeType_;
}
void DescribePriceRequest::setChargeType(const std::string& chargeType)
{
chargeType_ = chargeType;
setParameter("ChargeType", chargeType);
}
std::string DescribePriceRequest::getAccessKeyId()const
{
return accessKeyId_;
}
void DescribePriceRequest::setAccessKeyId(const std::string& accessKeyId)
{
accessKeyId_ = accessKeyId;
setParameter("AccessKeyId", accessKeyId);
}
std::string DescribePriceRequest::getOrderType()const
{
return orderType_;
}
void DescribePriceRequest::setOrderType(const std::string& orderType)
{
orderType_ = orderType;
setParameter("OrderType", orderType);
}

View File

@@ -0,0 +1,71 @@
/*
* 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/ehpc/model/DescribePriceResult.h>
#include <json/json.h>
using namespace AlibabaCloud::EHPC;
using namespace AlibabaCloud::EHPC::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 allPrices = value["Prices"]["PriceInfo"];
for (auto value : allPrices)
{
PriceInfo pricesObject;
if(!value["NodeType"].isNull())
pricesObject.nodeType = value["NodeType"].asString();
if(!value["OriginalPrice"].isNull())
pricesObject.originalPrice = std::stof(value["OriginalPrice"].asString());
if(!value["TradePrice"].isNull())
pricesObject.tradePrice = std::stof(value["TradePrice"].asString());
if(!value["Currency"].isNull())
pricesObject.currency = value["Currency"].asString();
prices_.push_back(pricesObject);
}
if(!value["TotalTradePrice"].isNull())
totalTradePrice_ = std::stof(value["TotalTradePrice"].asString());
}
std::vector<DescribePriceResult::PriceInfo> DescribePriceResult::getPrices()const
{
return prices_;
}
float DescribePriceResult::getTotalTradePrice()const
{
return totalTradePrice_;
}