Update SubscribeBillToOSS and QueryBillToOSSSubscription to support BucketPath.

This commit is contained in:
sdk-team
2022-05-19 13:51:25 +00:00
parent 2864623659
commit 91503d8320
13 changed files with 354 additions and 1 deletions

View File

@@ -1,3 +1,6 @@
2022-05-19 Version: 1.36.1130
- Update SubscribeBillToOSS and QueryBillToOSSSubscription to support BucketPath.
2022-05-19 Version: 1.36.1129
- Support all language.

View File

@@ -1 +1 @@
1.36.1129
1.36.1130

View File

@@ -171,6 +171,8 @@ set(bssopenapi_public_header_model
include/alibabacloud/bssopenapi/model/QueryUserOmsDataResult.h
include/alibabacloud/bssopenapi/model/RefundInstanceRequest.h
include/alibabacloud/bssopenapi/model/RefundInstanceResult.h
include/alibabacloud/bssopenapi/model/ReleaseInstanceRequest.h
include/alibabacloud/bssopenapi/model/ReleaseInstanceResult.h
include/alibabacloud/bssopenapi/model/RelieveAccountRelationRequest.h
include/alibabacloud/bssopenapi/model/RelieveAccountRelationResult.h
include/alibabacloud/bssopenapi/model/RenewInstanceRequest.h
@@ -354,6 +356,8 @@ set(bssopenapi_src
src/model/QueryUserOmsDataResult.cc
src/model/RefundInstanceRequest.cc
src/model/RefundInstanceResult.cc
src/model/ReleaseInstanceRequest.cc
src/model/ReleaseInstanceResult.cc
src/model/RelieveAccountRelationRequest.cc
src/model/RelieveAccountRelationResult.cc
src/model/RenewInstanceRequest.cc

View File

@@ -172,6 +172,8 @@
#include "model/QueryUserOmsDataResult.h"
#include "model/RefundInstanceRequest.h"
#include "model/RefundInstanceResult.h"
#include "model/ReleaseInstanceRequest.h"
#include "model/ReleaseInstanceResult.h"
#include "model/RelieveAccountRelationRequest.h"
#include "model/RelieveAccountRelationResult.h"
#include "model/RenewInstanceRequest.h"
@@ -436,6 +438,9 @@ namespace AlibabaCloud
typedef Outcome<Error, Model::RefundInstanceResult> RefundInstanceOutcome;
typedef std::future<RefundInstanceOutcome> RefundInstanceOutcomeCallable;
typedef std::function<void(const BssOpenApiClient*, const Model::RefundInstanceRequest&, const RefundInstanceOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RefundInstanceAsyncHandler;
typedef Outcome<Error, Model::ReleaseInstanceResult> ReleaseInstanceOutcome;
typedef std::future<ReleaseInstanceOutcome> ReleaseInstanceOutcomeCallable;
typedef std::function<void(const BssOpenApiClient*, const Model::ReleaseInstanceRequest&, const ReleaseInstanceOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ReleaseInstanceAsyncHandler;
typedef Outcome<Error, Model::RelieveAccountRelationResult> RelieveAccountRelationOutcome;
typedef std::future<RelieveAccountRelationOutcome> RelieveAccountRelationOutcomeCallable;
typedef std::function<void(const BssOpenApiClient*, const Model::RelieveAccountRelationRequest&, const RelieveAccountRelationOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RelieveAccountRelationAsyncHandler;
@@ -711,6 +716,9 @@ namespace AlibabaCloud
RefundInstanceOutcome refundInstance(const Model::RefundInstanceRequest &request)const;
void refundInstanceAsync(const Model::RefundInstanceRequest& request, const RefundInstanceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
RefundInstanceOutcomeCallable refundInstanceCallable(const Model::RefundInstanceRequest& request) const;
ReleaseInstanceOutcome releaseInstance(const Model::ReleaseInstanceRequest &request)const;
void releaseInstanceAsync(const Model::ReleaseInstanceRequest& request, const ReleaseInstanceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
ReleaseInstanceOutcomeCallable releaseInstanceCallable(const Model::ReleaseInstanceRequest& request) const;
RelieveAccountRelationOutcome relieveAccountRelation(const Model::RelieveAccountRelationRequest &request)const;
void relieveAccountRelationAsync(const Model::RelieveAccountRelationRequest& request, const RelieveAccountRelationAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
RelieveAccountRelationOutcomeCallable relieveAccountRelationCallable(const Model::RelieveAccountRelationRequest& request) const;

View File

@@ -39,6 +39,7 @@ namespace AlibabaCloud
std::string subscribeBucket;
std::string subscribeTime;
std::string subscribeType;
std::string bucketPath;
long bucketOwnerId;
std::string multAccountRelSubscribe;
std::string subscribeLanguage;

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_BSSOPENAPI_MODEL_RELEASEINSTANCEREQUEST_H_
#define ALIBABACLOUD_BSSOPENAPI_MODEL_RELEASEINSTANCEREQUEST_H_
#include <alibabacloud/bssopenapi/BssOpenApiExport.h>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <string>
#include <vector>
#include <map>
namespace AlibabaCloud {
namespace BssOpenApi {
namespace Model {
class ALIBABACLOUD_BSSOPENAPI_EXPORT ReleaseInstanceRequest : public RpcServiceRequest {
public:
ReleaseInstanceRequest();
~ReleaseInstanceRequest();
std::string getProductCode() const;
void setProductCode(const std::string &productCode);
std::string getSubscriptionType() const;
void setSubscriptionType(const std::string &subscriptionType);
long getOwnerId() const;
void setOwnerId(long ownerId);
std::string getProductType() const;
void setProductType(const std::string &productType);
std::string getInstanceIds() const;
void setInstanceIds(const std::string &instanceIds);
std::string getRegion() const;
void setRegion(const std::string &region);
std::string getRenewStatus() const;
void setRenewStatus(const std::string &renewStatus);
private:
std::string productCode_;
std::string subscriptionType_;
long ownerId_;
std::string productType_;
std::string instanceIds_;
std::string region_;
std::string renewStatus_;
};
} // namespace Model
} // namespace BssOpenApi
} // namespace AlibabaCloud
#endif // !ALIBABACLOUD_BSSOPENAPI_MODEL_RELEASEINSTANCEREQUEST_H_

View File

@@ -0,0 +1,62 @@
/*
* 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_BSSOPENAPI_MODEL_RELEASEINSTANCERESULT_H_
#define ALIBABACLOUD_BSSOPENAPI_MODEL_RELEASEINSTANCERESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/bssopenapi/BssOpenApiExport.h>
namespace AlibabaCloud
{
namespace BssOpenApi
{
namespace Model
{
class ALIBABACLOUD_BSSOPENAPI_EXPORT ReleaseInstanceResult : public ServiceResult
{
public:
struct Data
{
bool releaseResult;
std::string hostId;
};
ReleaseInstanceResult();
explicit ReleaseInstanceResult(const std::string &payload);
~ReleaseInstanceResult();
std::string getMessage()const;
Data getData()const;
std::string getCode()const;
bool getSuccess()const;
protected:
void parse(const std::string &payload);
private:
std::string message_;
Data data_;
std::string code_;
bool success_;
};
}
}
}
#endif // !ALIBABACLOUD_BSSOPENAPI_MODEL_RELEASEINSTANCERESULT_H_

View File

@@ -36,6 +36,8 @@ public:
void setSubscribeType(const std::string &subscribeType);
std::string getSubscribeBucket() const;
void setSubscribeBucket(const std::string &subscribeBucket);
std::string getBucketPath() const;
void setBucketPath(const std::string &bucketPath);
std::string getBeginBillingCycle() const;
void setBeginBillingCycle(const std::string &beginBillingCycle);
std::string getMultAccountRelSubscribe() const;
@@ -45,6 +47,7 @@ private:
long bucketOwnerId_;
std::string subscribeType_;
std::string subscribeBucket_;
std::string bucketPath_;
std::string beginBillingCycle_;
std::string multAccountRelSubscribe_;
};

View File

@@ -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();

View File

@@ -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())

View 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 &region) {
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);
}

View 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_;
}

View File

@@ -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_;
}