Add ModifyInstanceProperties.
This commit is contained in:
@@ -24,14 +24,18 @@ set(wss_public_header_model
|
||||
include/alibabacloud/wss/model/DescribeDeliveryAddressRequest.h
|
||||
include/alibabacloud/wss/model/DescribeDeliveryAddressResult.h
|
||||
include/alibabacloud/wss/model/DescribePackageDeductionsRequest.h
|
||||
include/alibabacloud/wss/model/DescribePackageDeductionsResult.h )
|
||||
include/alibabacloud/wss/model/DescribePackageDeductionsResult.h
|
||||
include/alibabacloud/wss/model/ModifyInstancePropertiesRequest.h
|
||||
include/alibabacloud/wss/model/ModifyInstancePropertiesResult.h )
|
||||
|
||||
set(wss_src
|
||||
src/WssClient.cc
|
||||
src/model/DescribeDeliveryAddressRequest.cc
|
||||
src/model/DescribeDeliveryAddressResult.cc
|
||||
src/model/DescribePackageDeductionsRequest.cc
|
||||
src/model/DescribePackageDeductionsResult.cc )
|
||||
src/model/DescribePackageDeductionsResult.cc
|
||||
src/model/ModifyInstancePropertiesRequest.cc
|
||||
src/model/ModifyInstancePropertiesResult.cc )
|
||||
|
||||
add_library(wss ${LIB_TYPE}
|
||||
${wss_public_header}
|
||||
|
||||
@@ -26,6 +26,8 @@
|
||||
#include "model/DescribeDeliveryAddressResult.h"
|
||||
#include "model/DescribePackageDeductionsRequest.h"
|
||||
#include "model/DescribePackageDeductionsResult.h"
|
||||
#include "model/ModifyInstancePropertiesRequest.h"
|
||||
#include "model/ModifyInstancePropertiesResult.h"
|
||||
|
||||
|
||||
namespace AlibabaCloud
|
||||
@@ -41,6 +43,9 @@ namespace AlibabaCloud
|
||||
typedef Outcome<Error, Model::DescribePackageDeductionsResult> DescribePackageDeductionsOutcome;
|
||||
typedef std::future<DescribePackageDeductionsOutcome> DescribePackageDeductionsOutcomeCallable;
|
||||
typedef std::function<void(const WssClient*, const Model::DescribePackageDeductionsRequest&, const DescribePackageDeductionsOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribePackageDeductionsAsyncHandler;
|
||||
typedef Outcome<Error, Model::ModifyInstancePropertiesResult> ModifyInstancePropertiesOutcome;
|
||||
typedef std::future<ModifyInstancePropertiesOutcome> ModifyInstancePropertiesOutcomeCallable;
|
||||
typedef std::function<void(const WssClient*, const Model::ModifyInstancePropertiesRequest&, const ModifyInstancePropertiesOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ModifyInstancePropertiesAsyncHandler;
|
||||
|
||||
WssClient(const Credentials &credentials, const ClientConfiguration &configuration);
|
||||
WssClient(const std::shared_ptr<CredentialsProvider> &credentialsProvider, const ClientConfiguration &configuration);
|
||||
@@ -52,6 +57,9 @@ namespace AlibabaCloud
|
||||
DescribePackageDeductionsOutcome describePackageDeductions(const Model::DescribePackageDeductionsRequest &request)const;
|
||||
void describePackageDeductionsAsync(const Model::DescribePackageDeductionsRequest& request, const DescribePackageDeductionsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
DescribePackageDeductionsOutcomeCallable describePackageDeductionsCallable(const Model::DescribePackageDeductionsRequest& request) const;
|
||||
ModifyInstancePropertiesOutcome modifyInstanceProperties(const Model::ModifyInstancePropertiesRequest &request)const;
|
||||
void modifyInstancePropertiesAsync(const Model::ModifyInstancePropertiesRequest& request, const ModifyInstancePropertiesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
ModifyInstancePropertiesOutcomeCallable modifyInstancePropertiesCallable(const Model::ModifyInstancePropertiesRequest& request) const;
|
||||
|
||||
private:
|
||||
std::shared_ptr<EndpointProvider> endpointProvider_;
|
||||
|
||||
@@ -30,6 +30,10 @@ class ALIBABACLOUD_WSS_EXPORT DescribePackageDeductionsRequest : public RpcServi
|
||||
public:
|
||||
DescribePackageDeductionsRequest();
|
||||
~DescribePackageDeductionsRequest();
|
||||
long getEndTime() const;
|
||||
void setEndTime(long endTime);
|
||||
long getStartTime() const;
|
||||
void setStartTime(long startTime);
|
||||
int getPageNum() const;
|
||||
void setPageNum(int pageNum);
|
||||
std::string getResourceType() const;
|
||||
@@ -42,6 +46,8 @@ public:
|
||||
void setPageSize(int pageSize);
|
||||
|
||||
private:
|
||||
long endTime_;
|
||||
long startTime_;
|
||||
int pageNum_;
|
||||
std::string resourceType_;
|
||||
std::vector<std::string> packageIds_;
|
||||
|
||||
@@ -57,7 +57,9 @@ namespace AlibabaCloud
|
||||
long getTotalCount()const;
|
||||
int getPageNum()const;
|
||||
int getPageSize()const;
|
||||
long getTotalUsedTime()const;
|
||||
std::vector<Deduction> getDeductions()const;
|
||||
float getTotalUsedCoreTime()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
@@ -65,7 +67,9 @@ namespace AlibabaCloud
|
||||
long totalCount_;
|
||||
int pageNum_;
|
||||
int pageSize_;
|
||||
long totalUsedTime_;
|
||||
std::vector<Deduction> deductions_;
|
||||
float totalUsedCoreTime_;
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* 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_WSS_MODEL_MODIFYINSTANCEPROPERTIESREQUEST_H_
|
||||
#define ALIBABACLOUD_WSS_MODEL_MODIFYINSTANCEPROPERTIESREQUEST_H_
|
||||
|
||||
#include <alibabacloud/wss/WssExport.h>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
namespace AlibabaCloud {
|
||||
namespace Wss {
|
||||
namespace Model {
|
||||
class ALIBABACLOUD_WSS_EXPORT ModifyInstancePropertiesRequest : public RpcServiceRequest {
|
||||
public:
|
||||
ModifyInstancePropertiesRequest();
|
||||
~ModifyInstancePropertiesRequest();
|
||||
std::string getResourceType() const;
|
||||
void setResourceType(const std::string &resourceType);
|
||||
std::string getInstanceId() const;
|
||||
void setInstanceId(const std::string &instanceId);
|
||||
std::vector<std::string> getInstanceIds() const;
|
||||
void setInstanceIds(const std::vector<std::string> &instanceIds);
|
||||
std::string getValue() const;
|
||||
void setValue(const std::string &value);
|
||||
std::string getKey() const;
|
||||
void setKey(const std::string &key);
|
||||
|
||||
private:
|
||||
std::string resourceType_;
|
||||
std::string instanceId_;
|
||||
std::vector<std::string> instanceIds_;
|
||||
std::string value_;
|
||||
std::string key_;
|
||||
};
|
||||
} // namespace Model
|
||||
} // namespace Wss
|
||||
} // namespace AlibabaCloud
|
||||
#endif // !ALIBABACLOUD_WSS_MODEL_MODIFYINSTANCEPROPERTIESREQUEST_H_
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* 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_WSS_MODEL_MODIFYINSTANCEPROPERTIESRESULT_H_
|
||||
#define ALIBABACLOUD_WSS_MODEL_MODIFYINSTANCEPROPERTIESRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/wss/WssExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Wss
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_WSS_EXPORT ModifyInstancePropertiesResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
ModifyInstancePropertiesResult();
|
||||
explicit ModifyInstancePropertiesResult(const std::string &payload);
|
||||
~ModifyInstancePropertiesResult();
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_WSS_MODEL_MODIFYINSTANCEPROPERTIESRESULT_H_
|
||||
@@ -123,3 +123,39 @@ WssClient::DescribePackageDeductionsOutcomeCallable WssClient::describePackageDe
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
WssClient::ModifyInstancePropertiesOutcome WssClient::modifyInstanceProperties(const ModifyInstancePropertiesRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return ModifyInstancePropertiesOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return ModifyInstancePropertiesOutcome(ModifyInstancePropertiesResult(outcome.result()));
|
||||
else
|
||||
return ModifyInstancePropertiesOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void WssClient::modifyInstancePropertiesAsync(const ModifyInstancePropertiesRequest& request, const ModifyInstancePropertiesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, modifyInstanceProperties(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
WssClient::ModifyInstancePropertiesOutcomeCallable WssClient::modifyInstancePropertiesCallable(const ModifyInstancePropertiesRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<ModifyInstancePropertiesOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->modifyInstanceProperties(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
|
||||
@@ -25,6 +25,24 @@ DescribePackageDeductionsRequest::DescribePackageDeductionsRequest()
|
||||
|
||||
DescribePackageDeductionsRequest::~DescribePackageDeductionsRequest() {}
|
||||
|
||||
long DescribePackageDeductionsRequest::getEndTime() const {
|
||||
return endTime_;
|
||||
}
|
||||
|
||||
void DescribePackageDeductionsRequest::setEndTime(long endTime) {
|
||||
endTime_ = endTime;
|
||||
setParameter(std::string("EndTime"), std::to_string(endTime));
|
||||
}
|
||||
|
||||
long DescribePackageDeductionsRequest::getStartTime() const {
|
||||
return startTime_;
|
||||
}
|
||||
|
||||
void DescribePackageDeductionsRequest::setStartTime(long startTime) {
|
||||
startTime_ = startTime;
|
||||
setParameter(std::string("StartTime"), std::to_string(startTime));
|
||||
}
|
||||
|
||||
int DescribePackageDeductionsRequest::getPageNum() const {
|
||||
return pageNum_;
|
||||
}
|
||||
|
||||
@@ -79,6 +79,10 @@ void DescribePackageDeductionsResult::parse(const std::string &payload)
|
||||
pageSize_ = std::stoi(value["PageSize"].asString());
|
||||
if(!value["TotalCount"].isNull())
|
||||
totalCount_ = std::stol(value["TotalCount"].asString());
|
||||
if(!value["TotalUsedTime"].isNull())
|
||||
totalUsedTime_ = std::stol(value["TotalUsedTime"].asString());
|
||||
if(!value["TotalUsedCoreTime"].isNull())
|
||||
totalUsedCoreTime_ = std::stof(value["TotalUsedCoreTime"].asString());
|
||||
|
||||
}
|
||||
|
||||
@@ -97,8 +101,18 @@ int DescribePackageDeductionsResult::getPageSize()const
|
||||
return pageSize_;
|
||||
}
|
||||
|
||||
long DescribePackageDeductionsResult::getTotalUsedTime()const
|
||||
{
|
||||
return totalUsedTime_;
|
||||
}
|
||||
|
||||
std::vector<DescribePackageDeductionsResult::Deduction> DescribePackageDeductionsResult::getDeductions()const
|
||||
{
|
||||
return deductions_;
|
||||
}
|
||||
|
||||
float DescribePackageDeductionsResult::getTotalUsedCoreTime()const
|
||||
{
|
||||
return totalUsedCoreTime_;
|
||||
}
|
||||
|
||||
|
||||
71
wss/src/model/ModifyInstancePropertiesRequest.cc
Normal file
71
wss/src/model/ModifyInstancePropertiesRequest.cc
Normal 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/wss/model/ModifyInstancePropertiesRequest.h>
|
||||
|
||||
using AlibabaCloud::Wss::Model::ModifyInstancePropertiesRequest;
|
||||
|
||||
ModifyInstancePropertiesRequest::ModifyInstancePropertiesRequest()
|
||||
: RpcServiceRequest("wss", "2021-12-21", "ModifyInstanceProperties") {
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
ModifyInstancePropertiesRequest::~ModifyInstancePropertiesRequest() {}
|
||||
|
||||
std::string ModifyInstancePropertiesRequest::getResourceType() const {
|
||||
return resourceType_;
|
||||
}
|
||||
|
||||
void ModifyInstancePropertiesRequest::setResourceType(const std::string &resourceType) {
|
||||
resourceType_ = resourceType;
|
||||
setParameter(std::string("ResourceType"), resourceType);
|
||||
}
|
||||
|
||||
std::string ModifyInstancePropertiesRequest::getInstanceId() const {
|
||||
return instanceId_;
|
||||
}
|
||||
|
||||
void ModifyInstancePropertiesRequest::setInstanceId(const std::string &instanceId) {
|
||||
instanceId_ = instanceId;
|
||||
setParameter(std::string("InstanceId"), instanceId);
|
||||
}
|
||||
|
||||
std::vector<std::string> ModifyInstancePropertiesRequest::getInstanceIds() const {
|
||||
return instanceIds_;
|
||||
}
|
||||
|
||||
void ModifyInstancePropertiesRequest::setInstanceIds(const std::vector<std::string> &instanceIds) {
|
||||
instanceIds_ = instanceIds;
|
||||
}
|
||||
|
||||
std::string ModifyInstancePropertiesRequest::getValue() const {
|
||||
return value_;
|
||||
}
|
||||
|
||||
void ModifyInstancePropertiesRequest::setValue(const std::string &value) {
|
||||
value_ = value;
|
||||
setParameter(std::string("Value"), value);
|
||||
}
|
||||
|
||||
std::string ModifyInstancePropertiesRequest::getKey() const {
|
||||
return key_;
|
||||
}
|
||||
|
||||
void ModifyInstancePropertiesRequest::setKey(const std::string &key) {
|
||||
key_ = key;
|
||||
setParameter(std::string("Key"), key);
|
||||
}
|
||||
|
||||
44
wss/src/model/ModifyInstancePropertiesResult.cc
Normal file
44
wss/src/model/ModifyInstancePropertiesResult.cc
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* 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/wss/model/ModifyInstancePropertiesResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Wss;
|
||||
using namespace AlibabaCloud::Wss::Model;
|
||||
|
||||
ModifyInstancePropertiesResult::ModifyInstancePropertiesResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
ModifyInstancePropertiesResult::ModifyInstancePropertiesResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
ModifyInstancePropertiesResult::~ModifyInstancePropertiesResult()
|
||||
{}
|
||||
|
||||
void ModifyInstancePropertiesResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user