1 /**
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  * SPDX-License-Identifier: Apache-2.0.
4  */
5 
6 #pragma once
7 #include <aws/autoscaling-plans/AutoScalingPlans_EXPORTS.h>
8 #include <aws/autoscaling-plans/AutoScalingPlansErrors.h>
9 #include <aws/core/client/AWSError.h>
10 #include <aws/core/client/ClientConfiguration.h>
11 #include <aws/core/client/AWSClient.h>
12 #include <aws/core/utils/memory/stl/AWSString.h>
13 #include <aws/core/utils/json/JsonSerializer.h>
14 #include <aws/autoscaling-plans/model/CreateScalingPlanResult.h>
15 #include <aws/autoscaling-plans/model/DeleteScalingPlanResult.h>
16 #include <aws/autoscaling-plans/model/DescribeScalingPlanResourcesResult.h>
17 #include <aws/autoscaling-plans/model/DescribeScalingPlansResult.h>
18 #include <aws/autoscaling-plans/model/GetScalingPlanResourceForecastDataResult.h>
19 #include <aws/autoscaling-plans/model/UpdateScalingPlanResult.h>
20 #include <aws/core/client/AsyncCallerContext.h>
21 #include <aws/core/http/HttpTypes.h>
22 #include <future>
23 #include <functional>
24 
25 namespace Aws
26 {
27 
28 namespace Http
29 {
30   class HttpClient;
31   class HttpClientFactory;
32 } // namespace Http
33 
34 namespace Utils
35 {
36   template< typename R, typename E> class Outcome;
37 namespace Threading
38 {
39   class Executor;
40 } // namespace Threading
41 } // namespace Utils
42 
43 namespace Auth
44 {
45   class AWSCredentials;
46   class AWSCredentialsProvider;
47 } // namespace Auth
48 
49 namespace Client
50 {
51   class RetryStrategy;
52 } // namespace Client
53 
54 namespace AutoScalingPlans
55 {
56 
57 namespace Model
58 {
59         class CreateScalingPlanRequest;
60         class DeleteScalingPlanRequest;
61         class DescribeScalingPlanResourcesRequest;
62         class DescribeScalingPlansRequest;
63         class GetScalingPlanResourceForecastDataRequest;
64         class UpdateScalingPlanRequest;
65 
66         typedef Aws::Utils::Outcome<CreateScalingPlanResult, AutoScalingPlansError> CreateScalingPlanOutcome;
67         typedef Aws::Utils::Outcome<DeleteScalingPlanResult, AutoScalingPlansError> DeleteScalingPlanOutcome;
68         typedef Aws::Utils::Outcome<DescribeScalingPlanResourcesResult, AutoScalingPlansError> DescribeScalingPlanResourcesOutcome;
69         typedef Aws::Utils::Outcome<DescribeScalingPlansResult, AutoScalingPlansError> DescribeScalingPlansOutcome;
70         typedef Aws::Utils::Outcome<GetScalingPlanResourceForecastDataResult, AutoScalingPlansError> GetScalingPlanResourceForecastDataOutcome;
71         typedef Aws::Utils::Outcome<UpdateScalingPlanResult, AutoScalingPlansError> UpdateScalingPlanOutcome;
72 
73         typedef std::future<CreateScalingPlanOutcome> CreateScalingPlanOutcomeCallable;
74         typedef std::future<DeleteScalingPlanOutcome> DeleteScalingPlanOutcomeCallable;
75         typedef std::future<DescribeScalingPlanResourcesOutcome> DescribeScalingPlanResourcesOutcomeCallable;
76         typedef std::future<DescribeScalingPlansOutcome> DescribeScalingPlansOutcomeCallable;
77         typedef std::future<GetScalingPlanResourceForecastDataOutcome> GetScalingPlanResourceForecastDataOutcomeCallable;
78         typedef std::future<UpdateScalingPlanOutcome> UpdateScalingPlanOutcomeCallable;
79 } // namespace Model
80 
81   class AutoScalingPlansClient;
82 
83     typedef std::function<void(const AutoScalingPlansClient*, const Model::CreateScalingPlanRequest&, const Model::CreateScalingPlanOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > CreateScalingPlanResponseReceivedHandler;
84     typedef std::function<void(const AutoScalingPlansClient*, const Model::DeleteScalingPlanRequest&, const Model::DeleteScalingPlanOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DeleteScalingPlanResponseReceivedHandler;
85     typedef std::function<void(const AutoScalingPlansClient*, const Model::DescribeScalingPlanResourcesRequest&, const Model::DescribeScalingPlanResourcesOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DescribeScalingPlanResourcesResponseReceivedHandler;
86     typedef std::function<void(const AutoScalingPlansClient*, const Model::DescribeScalingPlansRequest&, const Model::DescribeScalingPlansOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DescribeScalingPlansResponseReceivedHandler;
87     typedef std::function<void(const AutoScalingPlansClient*, const Model::GetScalingPlanResourceForecastDataRequest&, const Model::GetScalingPlanResourceForecastDataOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > GetScalingPlanResourceForecastDataResponseReceivedHandler;
88     typedef std::function<void(const AutoScalingPlansClient*, const Model::UpdateScalingPlanRequest&, const Model::UpdateScalingPlanOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > UpdateScalingPlanResponseReceivedHandler;
89 
90   /**
91    * <fullname>AWS Auto Scaling</fullname> <p>Use AWS Auto Scaling to create scaling
92    * plans for your applications to automatically scale your scalable AWS resources.
93    * </p> <p> <b>API Summary</b> </p> <p>You can use the AWS Auto Scaling service API
94    * to accomplish the following tasks:</p> <ul> <li> <p>Create and manage scaling
95    * plans</p> </li> <li> <p>Define target tracking scaling policies to dynamically
96    * scale your resources based on utilization</p> </li> <li> <p>Scale Amazon EC2
97    * Auto Scaling groups using predictive scaling and dynamic scaling to scale your
98    * Amazon EC2 capacity faster</p> </li> <li> <p>Set minimum and maximum capacity
99    * limits</p> </li> <li> <p>Retrieve information on existing scaling plans</p>
100    * </li> <li> <p>Access current forecast data and historical forecast data for up
101    * to 56 days previous</p> </li> </ul> <p>To learn more about AWS Auto Scaling,
102    * including information about granting IAM users required permissions for AWS Auto
103    * Scaling actions, see the <a
104    * href="https://docs.aws.amazon.com/autoscaling/plans/userguide/what-is-aws-auto-scaling.html">AWS
105    * Auto Scaling User Guide</a>. </p>
106    */
107   class AWS_AUTOSCALINGPLANS_API AutoScalingPlansClient : public Aws::Client::AWSJsonClient
108   {
109     public:
110       typedef Aws::Client::AWSJsonClient BASECLASS;
111 
112        /**
113         * Initializes client to use DefaultCredentialProviderChain, with default http client factory, and optional client config. If client config
114         * is not specified, it will be initialized to default values.
115         */
116         AutoScalingPlansClient(const Aws::Client::ClientConfiguration& clientConfiguration = Aws::Client::ClientConfiguration());
117 
118        /**
119         * Initializes client to use SimpleAWSCredentialsProvider, with default http client factory, and optional client config. If client config
120         * is not specified, it will be initialized to default values.
121         */
122         AutoScalingPlansClient(const Aws::Auth::AWSCredentials& credentials, const Aws::Client::ClientConfiguration& clientConfiguration = Aws::Client::ClientConfiguration());
123 
124        /**
125         * Initializes client to use specified credentials provider with specified client config. If http client factory is not supplied,
126         * the default http client factory will be used
127         */
128         AutoScalingPlansClient(const std::shared_ptr<Aws::Auth::AWSCredentialsProvider>& credentialsProvider,
129             const Aws::Client::ClientConfiguration& clientConfiguration = Aws::Client::ClientConfiguration());
130 
131         virtual ~AutoScalingPlansClient();
132 
133 
134         /**
135          * <p>Creates a scaling plan. </p><p><h3>See Also:</h3>   <a
136          * href="http://docs.aws.amazon.com/goto/WebAPI/autoscaling-plans-2018-01-06/CreateScalingPlan">AWS
137          * API Reference</a></p>
138          */
139         virtual Model::CreateScalingPlanOutcome CreateScalingPlan(const Model::CreateScalingPlanRequest& request) const;
140 
141         /**
142          * <p>Creates a scaling plan. </p><p><h3>See Also:</h3>   <a
143          * href="http://docs.aws.amazon.com/goto/WebAPI/autoscaling-plans-2018-01-06/CreateScalingPlan">AWS
144          * API Reference</a></p>
145          *
146          * returns a future to the operation so that it can be executed in parallel to other requests.
147          */
148         virtual Model::CreateScalingPlanOutcomeCallable CreateScalingPlanCallable(const Model::CreateScalingPlanRequest& request) const;
149 
150         /**
151          * <p>Creates a scaling plan. </p><p><h3>See Also:</h3>   <a
152          * href="http://docs.aws.amazon.com/goto/WebAPI/autoscaling-plans-2018-01-06/CreateScalingPlan">AWS
153          * API Reference</a></p>
154          *
155          * Queues the request into a thread executor and triggers associated callback when operation has finished.
156          */
157         virtual void CreateScalingPlanAsync(const Model::CreateScalingPlanRequest& request, const CreateScalingPlanResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
158 
159         /**
160          * <p>Deletes the specified scaling plan.</p> <p>Deleting a scaling plan deletes
161          * the underlying <a>ScalingInstruction</a> for all of the scalable resources that
162          * are covered by the plan.</p> <p>If the plan has launched resources or has
163          * scaling activities in progress, you must delete those resources
164          * separately.</p><p><h3>See Also:</h3>   <a
165          * href="http://docs.aws.amazon.com/goto/WebAPI/autoscaling-plans-2018-01-06/DeleteScalingPlan">AWS
166          * API Reference</a></p>
167          */
168         virtual Model::DeleteScalingPlanOutcome DeleteScalingPlan(const Model::DeleteScalingPlanRequest& request) const;
169 
170         /**
171          * <p>Deletes the specified scaling plan.</p> <p>Deleting a scaling plan deletes
172          * the underlying <a>ScalingInstruction</a> for all of the scalable resources that
173          * are covered by the plan.</p> <p>If the plan has launched resources or has
174          * scaling activities in progress, you must delete those resources
175          * separately.</p><p><h3>See Also:</h3>   <a
176          * href="http://docs.aws.amazon.com/goto/WebAPI/autoscaling-plans-2018-01-06/DeleteScalingPlan">AWS
177          * API Reference</a></p>
178          *
179          * returns a future to the operation so that it can be executed in parallel to other requests.
180          */
181         virtual Model::DeleteScalingPlanOutcomeCallable DeleteScalingPlanCallable(const Model::DeleteScalingPlanRequest& request) const;
182 
183         /**
184          * <p>Deletes the specified scaling plan.</p> <p>Deleting a scaling plan deletes
185          * the underlying <a>ScalingInstruction</a> for all of the scalable resources that
186          * are covered by the plan.</p> <p>If the plan has launched resources or has
187          * scaling activities in progress, you must delete those resources
188          * separately.</p><p><h3>See Also:</h3>   <a
189          * href="http://docs.aws.amazon.com/goto/WebAPI/autoscaling-plans-2018-01-06/DeleteScalingPlan">AWS
190          * API Reference</a></p>
191          *
192          * Queues the request into a thread executor and triggers associated callback when operation has finished.
193          */
194         virtual void DeleteScalingPlanAsync(const Model::DeleteScalingPlanRequest& request, const DeleteScalingPlanResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
195 
196         /**
197          * <p>Describes the scalable resources in the specified scaling plan.</p><p><h3>See
198          * Also:</h3>   <a
199          * href="http://docs.aws.amazon.com/goto/WebAPI/autoscaling-plans-2018-01-06/DescribeScalingPlanResources">AWS
200          * API Reference</a></p>
201          */
202         virtual Model::DescribeScalingPlanResourcesOutcome DescribeScalingPlanResources(const Model::DescribeScalingPlanResourcesRequest& request) const;
203 
204         /**
205          * <p>Describes the scalable resources in the specified scaling plan.</p><p><h3>See
206          * Also:</h3>   <a
207          * href="http://docs.aws.amazon.com/goto/WebAPI/autoscaling-plans-2018-01-06/DescribeScalingPlanResources">AWS
208          * API Reference</a></p>
209          *
210          * returns a future to the operation so that it can be executed in parallel to other requests.
211          */
212         virtual Model::DescribeScalingPlanResourcesOutcomeCallable DescribeScalingPlanResourcesCallable(const Model::DescribeScalingPlanResourcesRequest& request) const;
213 
214         /**
215          * <p>Describes the scalable resources in the specified scaling plan.</p><p><h3>See
216          * Also:</h3>   <a
217          * href="http://docs.aws.amazon.com/goto/WebAPI/autoscaling-plans-2018-01-06/DescribeScalingPlanResources">AWS
218          * API Reference</a></p>
219          *
220          * Queues the request into a thread executor and triggers associated callback when operation has finished.
221          */
222         virtual void DescribeScalingPlanResourcesAsync(const Model::DescribeScalingPlanResourcesRequest& request, const DescribeScalingPlanResourcesResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
223 
224         /**
225          * <p>Describes one or more of your scaling plans.</p><p><h3>See Also:</h3>   <a
226          * href="http://docs.aws.amazon.com/goto/WebAPI/autoscaling-plans-2018-01-06/DescribeScalingPlans">AWS
227          * API Reference</a></p>
228          */
229         virtual Model::DescribeScalingPlansOutcome DescribeScalingPlans(const Model::DescribeScalingPlansRequest& request) const;
230 
231         /**
232          * <p>Describes one or more of your scaling plans.</p><p><h3>See Also:</h3>   <a
233          * href="http://docs.aws.amazon.com/goto/WebAPI/autoscaling-plans-2018-01-06/DescribeScalingPlans">AWS
234          * API Reference</a></p>
235          *
236          * returns a future to the operation so that it can be executed in parallel to other requests.
237          */
238         virtual Model::DescribeScalingPlansOutcomeCallable DescribeScalingPlansCallable(const Model::DescribeScalingPlansRequest& request) const;
239 
240         /**
241          * <p>Describes one or more of your scaling plans.</p><p><h3>See Also:</h3>   <a
242          * href="http://docs.aws.amazon.com/goto/WebAPI/autoscaling-plans-2018-01-06/DescribeScalingPlans">AWS
243          * API Reference</a></p>
244          *
245          * Queues the request into a thread executor and triggers associated callback when operation has finished.
246          */
247         virtual void DescribeScalingPlansAsync(const Model::DescribeScalingPlansRequest& request, const DescribeScalingPlansResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
248 
249         /**
250          * <p>Retrieves the forecast data for a scalable resource.</p> <p>Capacity
251          * forecasts are represented as predicted values, or data points, that are
252          * calculated using historical data points from a specified CloudWatch load metric.
253          * Data points are available for up to 56 days. </p><p><h3>See Also:</h3>   <a
254          * href="http://docs.aws.amazon.com/goto/WebAPI/autoscaling-plans-2018-01-06/GetScalingPlanResourceForecastData">AWS
255          * API Reference</a></p>
256          */
257         virtual Model::GetScalingPlanResourceForecastDataOutcome GetScalingPlanResourceForecastData(const Model::GetScalingPlanResourceForecastDataRequest& request) const;
258 
259         /**
260          * <p>Retrieves the forecast data for a scalable resource.</p> <p>Capacity
261          * forecasts are represented as predicted values, or data points, that are
262          * calculated using historical data points from a specified CloudWatch load metric.
263          * Data points are available for up to 56 days. </p><p><h3>See Also:</h3>   <a
264          * href="http://docs.aws.amazon.com/goto/WebAPI/autoscaling-plans-2018-01-06/GetScalingPlanResourceForecastData">AWS
265          * API Reference</a></p>
266          *
267          * returns a future to the operation so that it can be executed in parallel to other requests.
268          */
269         virtual Model::GetScalingPlanResourceForecastDataOutcomeCallable GetScalingPlanResourceForecastDataCallable(const Model::GetScalingPlanResourceForecastDataRequest& request) const;
270 
271         /**
272          * <p>Retrieves the forecast data for a scalable resource.</p> <p>Capacity
273          * forecasts are represented as predicted values, or data points, that are
274          * calculated using historical data points from a specified CloudWatch load metric.
275          * Data points are available for up to 56 days. </p><p><h3>See Also:</h3>   <a
276          * href="http://docs.aws.amazon.com/goto/WebAPI/autoscaling-plans-2018-01-06/GetScalingPlanResourceForecastData">AWS
277          * API Reference</a></p>
278          *
279          * Queues the request into a thread executor and triggers associated callback when operation has finished.
280          */
281         virtual void GetScalingPlanResourceForecastDataAsync(const Model::GetScalingPlanResourceForecastDataRequest& request, const GetScalingPlanResourceForecastDataResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
282 
283         /**
284          * <p>Updates the specified scaling plan.</p> <p>You cannot update a scaling plan
285          * if it is in the process of being created, updated, or deleted.</p><p><h3>See
286          * Also:</h3>   <a
287          * href="http://docs.aws.amazon.com/goto/WebAPI/autoscaling-plans-2018-01-06/UpdateScalingPlan">AWS
288          * API Reference</a></p>
289          */
290         virtual Model::UpdateScalingPlanOutcome UpdateScalingPlan(const Model::UpdateScalingPlanRequest& request) const;
291 
292         /**
293          * <p>Updates the specified scaling plan.</p> <p>You cannot update a scaling plan
294          * if it is in the process of being created, updated, or deleted.</p><p><h3>See
295          * Also:</h3>   <a
296          * href="http://docs.aws.amazon.com/goto/WebAPI/autoscaling-plans-2018-01-06/UpdateScalingPlan">AWS
297          * API Reference</a></p>
298          *
299          * returns a future to the operation so that it can be executed in parallel to other requests.
300          */
301         virtual Model::UpdateScalingPlanOutcomeCallable UpdateScalingPlanCallable(const Model::UpdateScalingPlanRequest& request) const;
302 
303         /**
304          * <p>Updates the specified scaling plan.</p> <p>You cannot update a scaling plan
305          * if it is in the process of being created, updated, or deleted.</p><p><h3>See
306          * Also:</h3>   <a
307          * href="http://docs.aws.amazon.com/goto/WebAPI/autoscaling-plans-2018-01-06/UpdateScalingPlan">AWS
308          * API Reference</a></p>
309          *
310          * Queues the request into a thread executor and triggers associated callback when operation has finished.
311          */
312         virtual void UpdateScalingPlanAsync(const Model::UpdateScalingPlanRequest& request, const UpdateScalingPlanResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
313 
314 
315       void OverrideEndpoint(const Aws::String& endpoint);
316     private:
317       void init(const Aws::Client::ClientConfiguration& clientConfiguration);
318         void CreateScalingPlanAsyncHelper(const Model::CreateScalingPlanRequest& request, const CreateScalingPlanResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
319         void DeleteScalingPlanAsyncHelper(const Model::DeleteScalingPlanRequest& request, const DeleteScalingPlanResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
320         void DescribeScalingPlanResourcesAsyncHelper(const Model::DescribeScalingPlanResourcesRequest& request, const DescribeScalingPlanResourcesResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
321         void DescribeScalingPlansAsyncHelper(const Model::DescribeScalingPlansRequest& request, const DescribeScalingPlansResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
322         void GetScalingPlanResourceForecastDataAsyncHelper(const Model::GetScalingPlanResourceForecastDataRequest& request, const GetScalingPlanResourceForecastDataResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
323         void UpdateScalingPlanAsyncHelper(const Model::UpdateScalingPlanRequest& request, const UpdateScalingPlanResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
324 
325       Aws::String m_uri;
326       Aws::String m_configScheme;
327       std::shared_ptr<Aws::Utils::Threading::Executor> m_executor;
328   };
329 
330 } // namespace AutoScalingPlans
331 } // namespace Aws
332