Skip to content

Commit 6830235

Browse files
committed
Add ModifyInstanceProperties.
1 parent bc2d245 commit 6830235

12 files changed

+311
-3
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.36.2040
1+
1.36.2041

wss/CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,18 @@ set(wss_public_header_model
2424
include/alibabacloud/wss/model/DescribeDeliveryAddressRequest.h
2525
include/alibabacloud/wss/model/DescribeDeliveryAddressResult.h
2626
include/alibabacloud/wss/model/DescribePackageDeductionsRequest.h
27-
include/alibabacloud/wss/model/DescribePackageDeductionsResult.h )
27+
include/alibabacloud/wss/model/DescribePackageDeductionsResult.h
28+
include/alibabacloud/wss/model/ModifyInstancePropertiesRequest.h
29+
include/alibabacloud/wss/model/ModifyInstancePropertiesResult.h )
2830

2931
set(wss_src
3032
src/WssClient.cc
3133
src/model/DescribeDeliveryAddressRequest.cc
3234
src/model/DescribeDeliveryAddressResult.cc
3335
src/model/DescribePackageDeductionsRequest.cc
34-
src/model/DescribePackageDeductionsResult.cc )
36+
src/model/DescribePackageDeductionsResult.cc
37+
src/model/ModifyInstancePropertiesRequest.cc
38+
src/model/ModifyInstancePropertiesResult.cc )
3539

3640
add_library(wss ${LIB_TYPE}
3741
${wss_public_header}

wss/include/alibabacloud/wss/WssClient.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
#include "model/DescribeDeliveryAddressResult.h"
2727
#include "model/DescribePackageDeductionsRequest.h"
2828
#include "model/DescribePackageDeductionsResult.h"
29+
#include "model/ModifyInstancePropertiesRequest.h"
30+
#include "model/ModifyInstancePropertiesResult.h"
2931

3032

3133
namespace AlibabaCloud
@@ -41,6 +43,9 @@ namespace AlibabaCloud
4143
typedef Outcome<Error, Model::DescribePackageDeductionsResult> DescribePackageDeductionsOutcome;
4244
typedef std::future<DescribePackageDeductionsOutcome> DescribePackageDeductionsOutcomeCallable;
4345
typedef std::function<void(const WssClient*, const Model::DescribePackageDeductionsRequest&, const DescribePackageDeductionsOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribePackageDeductionsAsyncHandler;
46+
typedef Outcome<Error, Model::ModifyInstancePropertiesResult> ModifyInstancePropertiesOutcome;
47+
typedef std::future<ModifyInstancePropertiesOutcome> ModifyInstancePropertiesOutcomeCallable;
48+
typedef std::function<void(const WssClient*, const Model::ModifyInstancePropertiesRequest&, const ModifyInstancePropertiesOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ModifyInstancePropertiesAsyncHandler;
4449

4550
WssClient(const Credentials &credentials, const ClientConfiguration &configuration);
4651
WssClient(const std::shared_ptr<CredentialsProvider> &credentialsProvider, const ClientConfiguration &configuration);
@@ -52,6 +57,9 @@ namespace AlibabaCloud
5257
DescribePackageDeductionsOutcome describePackageDeductions(const Model::DescribePackageDeductionsRequest &request)const;
5358
void describePackageDeductionsAsync(const Model::DescribePackageDeductionsRequest& request, const DescribePackageDeductionsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
5459
DescribePackageDeductionsOutcomeCallable describePackageDeductionsCallable(const Model::DescribePackageDeductionsRequest& request) const;
60+
ModifyInstancePropertiesOutcome modifyInstanceProperties(const Model::ModifyInstancePropertiesRequest &request)const;
61+
void modifyInstancePropertiesAsync(const Model::ModifyInstancePropertiesRequest& request, const ModifyInstancePropertiesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
62+
ModifyInstancePropertiesOutcomeCallable modifyInstancePropertiesCallable(const Model::ModifyInstancePropertiesRequest& request) const;
5563

5664
private:
5765
std::shared_ptr<EndpointProvider> endpointProvider_;

wss/include/alibabacloud/wss/model/DescribePackageDeductionsRequest.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ class ALIBABACLOUD_WSS_EXPORT DescribePackageDeductionsRequest : public RpcServi
3030
public:
3131
DescribePackageDeductionsRequest();
3232
~DescribePackageDeductionsRequest();
33+
long getEndTime() const;
34+
void setEndTime(long endTime);
35+
long getStartTime() const;
36+
void setStartTime(long startTime);
3337
int getPageNum() const;
3438
void setPageNum(int pageNum);
3539
std::string getResourceType() const;
@@ -42,6 +46,8 @@ class ALIBABACLOUD_WSS_EXPORT DescribePackageDeductionsRequest : public RpcServi
4246
void setPageSize(int pageSize);
4347

4448
private:
49+
long endTime_;
50+
long startTime_;
4551
int pageNum_;
4652
std::string resourceType_;
4753
std::vector<std::string> packageIds_;

wss/include/alibabacloud/wss/model/DescribePackageDeductionsResult.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,19 @@ namespace AlibabaCloud
5757
long getTotalCount()const;
5858
int getPageNum()const;
5959
int getPageSize()const;
60+
long getTotalUsedTime()const;
6061
std::vector<Deduction> getDeductions()const;
62+
float getTotalUsedCoreTime()const;
6163

6264
protected:
6365
void parse(const std::string &payload);
6466
private:
6567
long totalCount_;
6668
int pageNum_;
6769
int pageSize_;
70+
long totalUsedTime_;
6871
std::vector<Deduction> deductions_;
72+
float totalUsedCoreTime_;
6973

7074
};
7175
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/*
2+
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
#ifndef ALIBABACLOUD_WSS_MODEL_MODIFYINSTANCEPROPERTIESREQUEST_H_
18+
#define ALIBABACLOUD_WSS_MODEL_MODIFYINSTANCEPROPERTIESREQUEST_H_
19+
20+
#include <alibabacloud/wss/WssExport.h>
21+
#include <alibabacloud/core/RpcServiceRequest.h>
22+
#include <string>
23+
#include <vector>
24+
#include <map>
25+
26+
namespace AlibabaCloud {
27+
namespace Wss {
28+
namespace Model {
29+
class ALIBABACLOUD_WSS_EXPORT ModifyInstancePropertiesRequest : public RpcServiceRequest {
30+
public:
31+
ModifyInstancePropertiesRequest();
32+
~ModifyInstancePropertiesRequest();
33+
std::string getResourceType() const;
34+
void setResourceType(const std::string &resourceType);
35+
std::string getInstanceId() const;
36+
void setInstanceId(const std::string &instanceId);
37+
std::vector<std::string> getInstanceIds() const;
38+
void setInstanceIds(const std::vector<std::string> &instanceIds);
39+
std::string getValue() const;
40+
void setValue(const std::string &value);
41+
std::string getKey() const;
42+
void setKey(const std::string &key);
43+
44+
private:
45+
std::string resourceType_;
46+
std::string instanceId_;
47+
std::vector<std::string> instanceIds_;
48+
std::string value_;
49+
std::string key_;
50+
};
51+
} // namespace Model
52+
} // namespace Wss
53+
} // namespace AlibabaCloud
54+
#endif // !ALIBABACLOUD_WSS_MODEL_MODIFYINSTANCEPROPERTIESREQUEST_H_
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/*
2+
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
#ifndef ALIBABACLOUD_WSS_MODEL_MODIFYINSTANCEPROPERTIESRESULT_H_
18+
#define ALIBABACLOUD_WSS_MODEL_MODIFYINSTANCEPROPERTIESRESULT_H_
19+
20+
#include <string>
21+
#include <vector>
22+
#include <utility>
23+
#include <alibabacloud/core/ServiceResult.h>
24+
#include <alibabacloud/wss/WssExport.h>
25+
26+
namespace AlibabaCloud
27+
{
28+
namespace Wss
29+
{
30+
namespace Model
31+
{
32+
class ALIBABACLOUD_WSS_EXPORT ModifyInstancePropertiesResult : public ServiceResult
33+
{
34+
public:
35+
36+
37+
ModifyInstancePropertiesResult();
38+
explicit ModifyInstancePropertiesResult(const std::string &payload);
39+
~ModifyInstancePropertiesResult();
40+
41+
protected:
42+
void parse(const std::string &payload);
43+
private:
44+
45+
};
46+
}
47+
}
48+
}
49+
#endif // !ALIBABACLOUD_WSS_MODEL_MODIFYINSTANCEPROPERTIESRESULT_H_

wss/src/WssClient.cc

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,3 +123,39 @@ WssClient::DescribePackageDeductionsOutcomeCallable WssClient::describePackageDe
123123
return task->get_future();
124124
}
125125

126+
WssClient::ModifyInstancePropertiesOutcome WssClient::modifyInstanceProperties(const ModifyInstancePropertiesRequest &request) const
127+
{
128+
auto endpointOutcome = endpointProvider_->getEndpoint();
129+
if (!endpointOutcome.isSuccess())
130+
return ModifyInstancePropertiesOutcome(endpointOutcome.error());
131+
132+
auto outcome = makeRequest(endpointOutcome.result(), request);
133+
134+
if (outcome.isSuccess())
135+
return ModifyInstancePropertiesOutcome(ModifyInstancePropertiesResult(outcome.result()));
136+
else
137+
return ModifyInstancePropertiesOutcome(outcome.error());
138+
}
139+
140+
void WssClient::modifyInstancePropertiesAsync(const ModifyInstancePropertiesRequest& request, const ModifyInstancePropertiesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
141+
{
142+
auto fn = [this, request, handler, context]()
143+
{
144+
handler(this, request, modifyInstanceProperties(request), context);
145+
};
146+
147+
asyncExecute(new Runnable(fn));
148+
}
149+
150+
WssClient::ModifyInstancePropertiesOutcomeCallable WssClient::modifyInstancePropertiesCallable(const ModifyInstancePropertiesRequest &request) const
151+
{
152+
auto task = std::make_shared<std::packaged_task<ModifyInstancePropertiesOutcome()>>(
153+
[this, request]()
154+
{
155+
return this->modifyInstanceProperties(request);
156+
});
157+
158+
asyncExecute(new Runnable([task]() { (*task)(); }));
159+
return task->get_future();
160+
}
161+

wss/src/model/DescribePackageDeductionsRequest.cc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,24 @@ DescribePackageDeductionsRequest::DescribePackageDeductionsRequest()
2525

2626
DescribePackageDeductionsRequest::~DescribePackageDeductionsRequest() {}
2727

28+
long DescribePackageDeductionsRequest::getEndTime() const {
29+
return endTime_;
30+
}
31+
32+
void DescribePackageDeductionsRequest::setEndTime(long endTime) {
33+
endTime_ = endTime;
34+
setParameter(std::string("EndTime"), std::to_string(endTime));
35+
}
36+
37+
long DescribePackageDeductionsRequest::getStartTime() const {
38+
return startTime_;
39+
}
40+
41+
void DescribePackageDeductionsRequest::setStartTime(long startTime) {
42+
startTime_ = startTime;
43+
setParameter(std::string("StartTime"), std::to_string(startTime));
44+
}
45+
2846
int DescribePackageDeductionsRequest::getPageNum() const {
2947
return pageNum_;
3048
}

wss/src/model/DescribePackageDeductionsResult.cc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ void DescribePackageDeductionsResult::parse(const std::string &payload)
7979
pageSize_ = std::stoi(value["PageSize"].asString());
8080
if(!value["TotalCount"].isNull())
8181
totalCount_ = std::stol(value["TotalCount"].asString());
82+
if(!value["TotalUsedTime"].isNull())
83+
totalUsedTime_ = std::stol(value["TotalUsedTime"].asString());
84+
if(!value["TotalUsedCoreTime"].isNull())
85+
totalUsedCoreTime_ = std::stof(value["TotalUsedCoreTime"].asString());
8286

8387
}
8488

@@ -97,8 +101,18 @@ int DescribePackageDeductionsResult::getPageSize()const
97101
return pageSize_;
98102
}
99103

104+
long DescribePackageDeductionsResult::getTotalUsedTime()const
105+
{
106+
return totalUsedTime_;
107+
}
108+
100109
std::vector<DescribePackageDeductionsResult::Deduction> DescribePackageDeductionsResult::getDeductions()const
101110
{
102111
return deductions_;
103112
}
104113

114+
float DescribePackageDeductionsResult::getTotalUsedCoreTime()const
115+
{
116+
return totalUsedCoreTime_;
117+
}
118+

0 commit comments

Comments
 (0)