From 683023585249e36c770b4884f233a8354c7c2fb5 Mon Sep 17 00:00:00 2001 From: sdk-team Date: Fri, 7 Feb 2025 10:05:43 +0000 Subject: [PATCH] Add ModifyInstanceProperties. --- VERSION | 2 +- wss/CMakeLists.txt | 8 ++- wss/include/alibabacloud/wss/WssClient.h | 8 +++ .../model/DescribePackageDeductionsRequest.h | 6 ++ .../model/DescribePackageDeductionsResult.h | 4 ++ .../model/ModifyInstancePropertiesRequest.h | 54 ++++++++++++++ .../model/ModifyInstancePropertiesResult.h | 49 +++++++++++++ wss/src/WssClient.cc | 36 ++++++++++ .../model/DescribePackageDeductionsRequest.cc | 18 +++++ .../model/DescribePackageDeductionsResult.cc | 14 ++++ .../model/ModifyInstancePropertiesRequest.cc | 71 +++++++++++++++++++ .../model/ModifyInstancePropertiesResult.cc | 44 ++++++++++++ 12 files changed, 311 insertions(+), 3 deletions(-) create mode 100644 wss/include/alibabacloud/wss/model/ModifyInstancePropertiesRequest.h create mode 100644 wss/include/alibabacloud/wss/model/ModifyInstancePropertiesResult.h create mode 100644 wss/src/model/ModifyInstancePropertiesRequest.cc create mode 100644 wss/src/model/ModifyInstancePropertiesResult.cc diff --git a/VERSION b/VERSION index ffc578e93..f2b8afad7 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.2040 \ No newline at end of file +1.36.2041 \ No newline at end of file diff --git a/wss/CMakeLists.txt b/wss/CMakeLists.txt index 764d8ca34..d2b4db1b6 100644 --- a/wss/CMakeLists.txt +++ b/wss/CMakeLists.txt @@ -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} diff --git a/wss/include/alibabacloud/wss/WssClient.h b/wss/include/alibabacloud/wss/WssClient.h index df90e2096..875c3c006 100644 --- a/wss/include/alibabacloud/wss/WssClient.h +++ b/wss/include/alibabacloud/wss/WssClient.h @@ -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 DescribePackageDeductionsOutcome; typedef std::future DescribePackageDeductionsOutcomeCallable; typedef std::function&)> DescribePackageDeductionsAsyncHandler; + typedef Outcome ModifyInstancePropertiesOutcome; + typedef std::future ModifyInstancePropertiesOutcomeCallable; + typedef std::function&)> ModifyInstancePropertiesAsyncHandler; WssClient(const Credentials &credentials, const ClientConfiguration &configuration); WssClient(const std::shared_ptr &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& 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& context = nullptr) const; + ModifyInstancePropertiesOutcomeCallable modifyInstancePropertiesCallable(const Model::ModifyInstancePropertiesRequest& request) const; private: std::shared_ptr endpointProvider_; diff --git a/wss/include/alibabacloud/wss/model/DescribePackageDeductionsRequest.h b/wss/include/alibabacloud/wss/model/DescribePackageDeductionsRequest.h index f0aa0c729..c7fcd1066 100644 --- a/wss/include/alibabacloud/wss/model/DescribePackageDeductionsRequest.h +++ b/wss/include/alibabacloud/wss/model/DescribePackageDeductionsRequest.h @@ -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 packageIds_; diff --git a/wss/include/alibabacloud/wss/model/DescribePackageDeductionsResult.h b/wss/include/alibabacloud/wss/model/DescribePackageDeductionsResult.h index ed346a389..73381f40b 100644 --- a/wss/include/alibabacloud/wss/model/DescribePackageDeductionsResult.h +++ b/wss/include/alibabacloud/wss/model/DescribePackageDeductionsResult.h @@ -57,7 +57,9 @@ namespace AlibabaCloud long getTotalCount()const; int getPageNum()const; int getPageSize()const; + long getTotalUsedTime()const; std::vector 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 deductions_; + float totalUsedCoreTime_; }; } diff --git a/wss/include/alibabacloud/wss/model/ModifyInstancePropertiesRequest.h b/wss/include/alibabacloud/wss/model/ModifyInstancePropertiesRequest.h new file mode 100644 index 000000000..a389aaaa9 --- /dev/null +++ b/wss/include/alibabacloud/wss/model/ModifyInstancePropertiesRequest.h @@ -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 +#include +#include +#include +#include + +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 getInstanceIds() const; + void setInstanceIds(const std::vector &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 instanceIds_; + std::string value_; + std::string key_; +}; +} // namespace Model +} // namespace Wss +} // namespace AlibabaCloud +#endif // !ALIBABACLOUD_WSS_MODEL_MODIFYINSTANCEPROPERTIESREQUEST_H_ diff --git a/wss/include/alibabacloud/wss/model/ModifyInstancePropertiesResult.h b/wss/include/alibabacloud/wss/model/ModifyInstancePropertiesResult.h new file mode 100644 index 000000000..773bedbdf --- /dev/null +++ b/wss/include/alibabacloud/wss/model/ModifyInstancePropertiesResult.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 +#include +#include +#include +#include + +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_ \ No newline at end of file diff --git a/wss/src/WssClient.cc b/wss/src/WssClient.cc index e632dbb87..f30577773 100644 --- a/wss/src/WssClient.cc +++ b/wss/src/WssClient.cc @@ -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& 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>( + [this, request]() + { + return this->modifyInstanceProperties(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + diff --git a/wss/src/model/DescribePackageDeductionsRequest.cc b/wss/src/model/DescribePackageDeductionsRequest.cc index e10b4880d..05b21b76c 100644 --- a/wss/src/model/DescribePackageDeductionsRequest.cc +++ b/wss/src/model/DescribePackageDeductionsRequest.cc @@ -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_; } diff --git a/wss/src/model/DescribePackageDeductionsResult.cc b/wss/src/model/DescribePackageDeductionsResult.cc index b4ceee43e..199984f84 100644 --- a/wss/src/model/DescribePackageDeductionsResult.cc +++ b/wss/src/model/DescribePackageDeductionsResult.cc @@ -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::getDeductions()const { return deductions_; } +float DescribePackageDeductionsResult::getTotalUsedCoreTime()const +{ + return totalUsedCoreTime_; +} + diff --git a/wss/src/model/ModifyInstancePropertiesRequest.cc b/wss/src/model/ModifyInstancePropertiesRequest.cc new file mode 100644 index 000000000..e3fdc7810 --- /dev/null +++ b/wss/src/model/ModifyInstancePropertiesRequest.cc @@ -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 + +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 ModifyInstancePropertiesRequest::getInstanceIds() const { + return instanceIds_; +} + +void ModifyInstancePropertiesRequest::setInstanceIds(const std::vector &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); +} + diff --git a/wss/src/model/ModifyInstancePropertiesResult.cc b/wss/src/model/ModifyInstancePropertiesResult.cc new file mode 100644 index 000000000..fc5a9561d --- /dev/null +++ b/wss/src/model/ModifyInstancePropertiesResult.cc @@ -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 +#include + +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()); + +} +