Update SubscribeBillToOSS and QueryBillToOSSSubscription to support BucketPath.
This commit is contained in:
@@ -2751,6 +2751,42 @@ BssOpenApiClient::RefundInstanceOutcomeCallable BssOpenApiClient::refundInstance
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
BssOpenApiClient::ReleaseInstanceOutcome BssOpenApiClient::releaseInstance(const ReleaseInstanceRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return ReleaseInstanceOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return ReleaseInstanceOutcome(ReleaseInstanceResult(outcome.result()));
|
||||
else
|
||||
return ReleaseInstanceOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void BssOpenApiClient::releaseInstanceAsync(const ReleaseInstanceRequest& request, const ReleaseInstanceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, releaseInstance(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
BssOpenApiClient::ReleaseInstanceOutcomeCallable BssOpenApiClient::releaseInstanceCallable(const ReleaseInstanceRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<ReleaseInstanceOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->releaseInstance(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
BssOpenApiClient::RelieveAccountRelationOutcome BssOpenApiClient::relieveAccountRelation(const RelieveAccountRelationRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
|
||||
@@ -60,6 +60,8 @@ void QueryBillToOSSSubscriptionResult::parse(const std::string &payload)
|
||||
itemObject.subscribeLanguage = dataNodeItemsItem["SubscribeLanguage"].asString();
|
||||
if(!dataNodeItemsItem["MultAccountRelSubscribe"].isNull())
|
||||
itemObject.multAccountRelSubscribe = dataNodeItemsItem["MultAccountRelSubscribe"].asString();
|
||||
if(!dataNodeItemsItem["BucketPath"].isNull())
|
||||
itemObject.bucketPath = dataNodeItemsItem["BucketPath"].asString();
|
||||
data_.items.push_back(itemObject);
|
||||
}
|
||||
if(!value["Code"].isNull())
|
||||
|
||||
90
bssopenapi/src/model/ReleaseInstanceRequest.cc
Normal file
90
bssopenapi/src/model/ReleaseInstanceRequest.cc
Normal 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/ReleaseInstanceRequest.h>
|
||||
|
||||
using AlibabaCloud::BssOpenApi::Model::ReleaseInstanceRequest;
|
||||
|
||||
ReleaseInstanceRequest::ReleaseInstanceRequest()
|
||||
: RpcServiceRequest("bssopenapi", "2017-12-14", "ReleaseInstance") {
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
ReleaseInstanceRequest::~ReleaseInstanceRequest() {}
|
||||
|
||||
std::string ReleaseInstanceRequest::getProductCode() const {
|
||||
return productCode_;
|
||||
}
|
||||
|
||||
void ReleaseInstanceRequest::setProductCode(const std::string &productCode) {
|
||||
productCode_ = productCode;
|
||||
setParameter(std::string("ProductCode"), productCode);
|
||||
}
|
||||
|
||||
std::string ReleaseInstanceRequest::getSubscriptionType() const {
|
||||
return subscriptionType_;
|
||||
}
|
||||
|
||||
void ReleaseInstanceRequest::setSubscriptionType(const std::string &subscriptionType) {
|
||||
subscriptionType_ = subscriptionType;
|
||||
setParameter(std::string("SubscriptionType"), subscriptionType);
|
||||
}
|
||||
|
||||
long ReleaseInstanceRequest::getOwnerId() const {
|
||||
return ownerId_;
|
||||
}
|
||||
|
||||
void ReleaseInstanceRequest::setOwnerId(long ownerId) {
|
||||
ownerId_ = ownerId;
|
||||
setParameter(std::string("OwnerId"), std::to_string(ownerId));
|
||||
}
|
||||
|
||||
std::string ReleaseInstanceRequest::getProductType() const {
|
||||
return productType_;
|
||||
}
|
||||
|
||||
void ReleaseInstanceRequest::setProductType(const std::string &productType) {
|
||||
productType_ = productType;
|
||||
setParameter(std::string("ProductType"), productType);
|
||||
}
|
||||
|
||||
std::string ReleaseInstanceRequest::getInstanceIds() const {
|
||||
return instanceIds_;
|
||||
}
|
||||
|
||||
void ReleaseInstanceRequest::setInstanceIds(const std::string &instanceIds) {
|
||||
instanceIds_ = instanceIds;
|
||||
setParameter(std::string("InstanceIds"), instanceIds);
|
||||
}
|
||||
|
||||
std::string ReleaseInstanceRequest::getRegion() const {
|
||||
return region_;
|
||||
}
|
||||
|
||||
void ReleaseInstanceRequest::setRegion(const std::string ®ion) {
|
||||
region_ = region;
|
||||
setParameter(std::string("Region"), region);
|
||||
}
|
||||
|
||||
std::string ReleaseInstanceRequest::getRenewStatus() const {
|
||||
return renewStatus_;
|
||||
}
|
||||
|
||||
void ReleaseInstanceRequest::setRenewStatus(const std::string &renewStatus) {
|
||||
renewStatus_ = renewStatus;
|
||||
setParameter(std::string("RenewStatus"), renewStatus);
|
||||
}
|
||||
|
||||
75
bssopenapi/src/model/ReleaseInstanceResult.cc
Normal file
75
bssopenapi/src/model/ReleaseInstanceResult.cc
Normal file
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
* 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/ReleaseInstanceResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::BssOpenApi;
|
||||
using namespace AlibabaCloud::BssOpenApi::Model;
|
||||
|
||||
ReleaseInstanceResult::ReleaseInstanceResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
ReleaseInstanceResult::ReleaseInstanceResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
ReleaseInstanceResult::~ReleaseInstanceResult()
|
||||
{}
|
||||
|
||||
void ReleaseInstanceResult::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["ReleaseResult"].isNull())
|
||||
data_.releaseResult = dataNode["ReleaseResult"].asString() == "true";
|
||||
if(!dataNode["HostId"].isNull())
|
||||
data_.hostId = dataNode["HostId"].asString();
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
if(!value["Code"].isNull())
|
||||
code_ = value["Code"].asString();
|
||||
if(!value["Success"].isNull())
|
||||
success_ = value["Success"].asString() == "true";
|
||||
|
||||
}
|
||||
|
||||
std::string ReleaseInstanceResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
ReleaseInstanceResult::Data ReleaseInstanceResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
std::string ReleaseInstanceResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
bool ReleaseInstanceResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
@@ -52,6 +52,15 @@ void SubscribeBillToOSSRequest::setSubscribeBucket(const std::string &subscribeB
|
||||
setParameter(std::string("SubscribeBucket"), subscribeBucket);
|
||||
}
|
||||
|
||||
std::string SubscribeBillToOSSRequest::getBucketPath() const {
|
||||
return bucketPath_;
|
||||
}
|
||||
|
||||
void SubscribeBillToOSSRequest::setBucketPath(const std::string &bucketPath) {
|
||||
bucketPath_ = bucketPath;
|
||||
setParameter(std::string("BucketPath"), bucketPath);
|
||||
}
|
||||
|
||||
std::string SubscribeBillToOSSRequest::getBeginBillingCycle() const {
|
||||
return beginBillingCycle_;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user