AWS SDK for C++  0.14.3
AWS SDK for C++
CloudWatchEventsClient.h
Go to the documentation of this file.
1 /*
2 * Copyright 2010-2016 Amazon.com, Inc. or its affiliates. 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 * A copy of the License is located at
7 *
8 * http://aws.amazon.com/apache2.0
9 *
10 * or in the "license" file accompanying this file. This file is distributed
11 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 * express or implied. See the License for the specific language governing
13 * permissions and limitations under the License.
14 */
15 #pragma once
32 #include <aws/core/NoResult.h>
35 #include <future>
36 #include <functional>
37 
38 namespace Aws
39 {
40 
41 namespace Http
42 {
43  class HttpClient;
44  class HttpClientFactory;
45 } // namespace Http
46 
47 namespace Utils
48 {
49  template< typename R, typename E> class Outcome;
50 
51 namespace Threading
52 {
53  class Executor;
54 } // namespace Threading
55 
56 namespace Json
57 {
58  class JsonValue;
59 } // namespace Json
60 } // namespace Utils
61 
62 namespace Auth
63 {
64  class AWSCredentials;
65  class AWSCredentialsProvider;
66 } // namespace Auth
67 
68 namespace Client
69 {
70  class RetryStrategy;
71 } // namespace Client
72 
73 namespace CloudWatchEvents
74 {
75 
76 namespace Model
77 {
78  class DeleteRuleRequest;
79  class DescribeRuleRequest;
80  class DisableRuleRequest;
81  class EnableRuleRequest;
83  class ListRulesRequest;
85  class PutEventsRequest;
86  class PutRuleRequest;
87  class PutTargetsRequest;
90 
103 
104  typedef std::future<DeleteRuleOutcome> DeleteRuleOutcomeCallable;
105  typedef std::future<DescribeRuleOutcome> DescribeRuleOutcomeCallable;
106  typedef std::future<DisableRuleOutcome> DisableRuleOutcomeCallable;
107  typedef std::future<EnableRuleOutcome> EnableRuleOutcomeCallable;
108  typedef std::future<ListRuleNamesByTargetOutcome> ListRuleNamesByTargetOutcomeCallable;
109  typedef std::future<ListRulesOutcome> ListRulesOutcomeCallable;
110  typedef std::future<ListTargetsByRuleOutcome> ListTargetsByRuleOutcomeCallable;
111  typedef std::future<PutEventsOutcome> PutEventsOutcomeCallable;
112  typedef std::future<PutRuleOutcome> PutRuleOutcomeCallable;
113  typedef std::future<PutTargetsOutcome> PutTargetsOutcomeCallable;
114  typedef std::future<RemoveTargetsOutcome> RemoveTargetsOutcomeCallable;
115  typedef std::future<TestEventPatternOutcome> TestEventPatternOutcomeCallable;
116 } // namespace Model
117 
119 
120  typedef std::function<void(const CloudWatchEventsClient*, const Model::DeleteRuleRequest&, const Model::DeleteRuleOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DeleteRuleResponseReceivedHandler;
121  typedef std::function<void(const CloudWatchEventsClient*, const Model::DescribeRuleRequest&, const Model::DescribeRuleOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DescribeRuleResponseReceivedHandler;
122  typedef std::function<void(const CloudWatchEventsClient*, const Model::DisableRuleRequest&, const Model::DisableRuleOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DisableRuleResponseReceivedHandler;
123  typedef std::function<void(const CloudWatchEventsClient*, const Model::EnableRuleRequest&, const Model::EnableRuleOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > EnableRuleResponseReceivedHandler;
124  typedef std::function<void(const CloudWatchEventsClient*, const Model::ListRuleNamesByTargetRequest&, const Model::ListRuleNamesByTargetOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > ListRuleNamesByTargetResponseReceivedHandler;
125  typedef std::function<void(const CloudWatchEventsClient*, const Model::ListRulesRequest&, const Model::ListRulesOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > ListRulesResponseReceivedHandler;
126  typedef std::function<void(const CloudWatchEventsClient*, const Model::ListTargetsByRuleRequest&, const Model::ListTargetsByRuleOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > ListTargetsByRuleResponseReceivedHandler;
127  typedef std::function<void(const CloudWatchEventsClient*, const Model::PutEventsRequest&, const Model::PutEventsOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > PutEventsResponseReceivedHandler;
128  typedef std::function<void(const CloudWatchEventsClient*, const Model::PutRuleRequest&, const Model::PutRuleOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > PutRuleResponseReceivedHandler;
129  typedef std::function<void(const CloudWatchEventsClient*, const Model::PutTargetsRequest&, const Model::PutTargetsOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > PutTargetsResponseReceivedHandler;
130  typedef std::function<void(const CloudWatchEventsClient*, const Model::RemoveTargetsRequest&, const Model::RemoveTargetsOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > RemoveTargetsResponseReceivedHandler;
131  typedef std::function<void(const CloudWatchEventsClient*, const Model::TestEventPatternRequest&, const Model::TestEventPatternOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > TestEventPatternResponseReceivedHandler;
132 
150  {
151  public:
153 
159 
165 
170  CloudWatchEventsClient(const std::shared_ptr<Auth::AWSCredentialsProvider>& credentialsProvider,
171  const Client::ClientConfiguration& clientConfiguration = Client::ClientConfiguration());
172 
173  virtual ~CloudWatchEventsClient();
174 
181  virtual Model::DeleteRuleOutcome DeleteRule(const Model::DeleteRuleRequest& request) const;
182 
191  virtual Model::DeleteRuleOutcomeCallable DeleteRuleCallable(const Model::DeleteRuleRequest& request) const;
192 
201  virtual void DeleteRuleAsync(const Model::DeleteRuleRequest& request, const DeleteRuleResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
202 
206  virtual Model::DescribeRuleOutcome DescribeRule(const Model::DescribeRuleRequest& request) const;
207 
213  virtual Model::DescribeRuleOutcomeCallable DescribeRuleCallable(const Model::DescribeRuleRequest& request) const;
214 
220  virtual void DescribeRuleAsync(const Model::DescribeRuleRequest& request, const DescribeRuleResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
221 
228  virtual Model::DisableRuleOutcome DisableRule(const Model::DisableRuleRequest& request) const;
229 
238  virtual Model::DisableRuleOutcomeCallable DisableRuleCallable(const Model::DisableRuleRequest& request) const;
239 
248  virtual void DisableRuleAsync(const Model::DisableRuleRequest& request, const DisableRuleResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
249 
256  virtual Model::EnableRuleOutcome EnableRule(const Model::EnableRuleRequest& request) const;
257 
266  virtual Model::EnableRuleOutcomeCallable EnableRuleCallable(const Model::EnableRuleRequest& request) const;
267 
276  virtual void EnableRuleAsync(const Model::EnableRuleRequest& request, const EnableRuleResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
277 
286  virtual Model::ListRuleNamesByTargetOutcome ListRuleNamesByTarget(const Model::ListRuleNamesByTargetRequest& request) const;
287 
298  virtual Model::ListRuleNamesByTargetOutcomeCallable ListRuleNamesByTargetCallable(const Model::ListRuleNamesByTargetRequest& request) const;
299 
310  virtual void ListRuleNamesByTargetAsync(const Model::ListRuleNamesByTargetRequest& request, const ListRuleNamesByTargetResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
311 
319  virtual Model::ListRulesOutcome ListRules(const Model::ListRulesRequest& request) const;
320 
330  virtual Model::ListRulesOutcomeCallable ListRulesCallable(const Model::ListRulesRequest& request) const;
331 
341  virtual void ListRulesAsync(const Model::ListRulesRequest& request, const ListRulesResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
342 
346  virtual Model::ListTargetsByRuleOutcome ListTargetsByRule(const Model::ListTargetsByRuleRequest& request) const;
347 
353  virtual Model::ListTargetsByRuleOutcomeCallable ListTargetsByRuleCallable(const Model::ListTargetsByRuleRequest& request) const;
354 
360  virtual void ListTargetsByRuleAsync(const Model::ListTargetsByRuleRequest& request, const ListTargetsByRuleResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
361 
366  virtual Model::PutEventsOutcome PutEvents(const Model::PutEventsRequest& request) const;
367 
374  virtual Model::PutEventsOutcomeCallable PutEventsCallable(const Model::PutEventsRequest& request) const;
375 
382  virtual void PutEventsAsync(const Model::PutEventsRequest& request, const PutEventsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
383 
400  virtual Model::PutRuleOutcome PutRule(const Model::PutRuleRequest& request) const;
401 
420  virtual Model::PutRuleOutcomeCallable PutRuleCallable(const Model::PutRuleRequest& request) const;
421 
440  virtual void PutRuleAsync(const Model::PutRuleRequest& request, const PutRuleResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
441 
467  virtual Model::PutTargetsOutcome PutTargets(const Model::PutTargetsRequest& request) const;
468 
496  virtual Model::PutTargetsOutcomeCallable PutTargetsCallable(const Model::PutTargetsRequest& request) const;
497 
525  virtual void PutTargetsAsync(const Model::PutTargetsRequest& request, const PutTargetsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
526 
534  virtual Model::RemoveTargetsOutcome RemoveTargets(const Model::RemoveTargetsRequest& request) const;
535 
545  virtual Model::RemoveTargetsOutcomeCallable RemoveTargetsCallable(const Model::RemoveTargetsRequest& request) const;
546 
556  virtual void RemoveTargetsAsync(const Model::RemoveTargetsRequest& request, const RemoveTargetsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
557 
566  virtual Model::TestEventPatternOutcome TestEventPattern(const Model::TestEventPatternRequest& request) const;
567 
578  virtual Model::TestEventPatternOutcomeCallable TestEventPatternCallable(const Model::TestEventPatternRequest& request) const;
579 
590  virtual void TestEventPatternAsync(const Model::TestEventPatternRequest& request, const TestEventPatternResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
591 
592 
593  private:
594  void init(const Client::ClientConfiguration& clientConfiguration);
595 
597  void DeleteRuleAsyncHelper(const Model::DeleteRuleRequest& request, const DeleteRuleResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
598  void DescribeRuleAsyncHelper(const Model::DescribeRuleRequest& request, const DescribeRuleResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
599  void DisableRuleAsyncHelper(const Model::DisableRuleRequest& request, const DisableRuleResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
600  void EnableRuleAsyncHelper(const Model::EnableRuleRequest& request, const EnableRuleResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
601  void ListRuleNamesByTargetAsyncHelper(const Model::ListRuleNamesByTargetRequest& request, const ListRuleNamesByTargetResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
602  void ListRulesAsyncHelper(const Model::ListRulesRequest& request, const ListRulesResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
603  void ListTargetsByRuleAsyncHelper(const Model::ListTargetsByRuleRequest& request, const ListTargetsByRuleResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
604  void PutEventsAsyncHelper(const Model::PutEventsRequest& request, const PutEventsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
605  void PutRuleAsyncHelper(const Model::PutRuleRequest& request, const PutRuleResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
606  void PutTargetsAsyncHelper(const Model::PutTargetsRequest& request, const PutTargetsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
607  void RemoveTargetsAsyncHelper(const Model::RemoveTargetsRequest& request, const RemoveTargetsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
608  void TestEventPatternAsyncHelper(const Model::TestEventPatternRequest& request, const TestEventPatternResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
609 
610  Aws::String m_uri;
611  std::shared_ptr<Utils::Threading::Executor> m_executor;
612  };
613 
614 } // namespace CloudWatchEvents
615 } // namespace Aws
Aws::Utils::Outcome< NoResult, Aws::Client::AWSError< CloudWatchEventsErrors > > DeleteRuleOutcome
std::future< PutTargetsOutcome > PutTargetsOutcomeCallable
#define AWS_CLOUDWATCHEVENTS_API
Aws::Utils::Outcome< ListTargetsByRuleResult, Aws::Client::AWSError< CloudWatchEventsErrors > > ListTargetsByRuleOutcome
Aws::Utils::Outcome< ListRulesResult, Aws::Client::AWSError< CloudWatchEventsErrors > > ListRulesOutcome
std::future< DeleteRuleOutcome > DeleteRuleOutcomeCallable
std::future< ListRulesOutcome > ListRulesOutcomeCallable
Aws::Utils::Outcome< RemoveTargetsResult, Aws::Client::AWSError< CloudWatchEventsErrors > > RemoveTargetsOutcome
std::function< void(const CloudWatchEventsClient *, const Model::ListTargetsByRuleRequest &, const Model::ListTargetsByRuleOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > ListTargetsByRuleResponseReceivedHandler
Aws::Utils::Outcome< ListRuleNamesByTargetResult, Aws::Client::AWSError< CloudWatchEventsErrors > > ListRuleNamesByTargetOutcome
std::function< void(const CloudWatchEventsClient *, const Model::DescribeRuleRequest &, const Model::DescribeRuleOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > DescribeRuleResponseReceivedHandler
std::future< TestEventPatternOutcome > TestEventPatternOutcomeCallable
std::future< PutRuleOutcome > PutRuleOutcomeCallable
std::function< void(const CloudWatchEventsClient *, const Model::ListRuleNamesByTargetRequest &, const Model::ListRuleNamesByTargetOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > ListRuleNamesByTargetResponseReceivedHandler
std::function< void(const CloudWatchEventsClient *, const Model::PutEventsRequest &, const Model::PutEventsOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > PutEventsResponseReceivedHandler
Aws::Utils::Outcome< PutTargetsResult, Aws::Client::AWSError< CloudWatchEventsErrors > > PutTargetsOutcome
std::function< void(const CloudWatchEventsClient *, const Model::DisableRuleRequest &, const Model::DisableRuleOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > DisableRuleResponseReceivedHandler
std::future< PutEventsOutcome > PutEventsOutcomeCallable
Aws::Utils::Outcome< NoResult, Aws::Client::AWSError< CloudWatchEventsErrors > > DisableRuleOutcome
Aws::Utils::Outcome< PutEventsResult, Aws::Client::AWSError< CloudWatchEventsErrors > > PutEventsOutcome
std::function< void(const CloudWatchEventsClient *, const Model::PutTargetsRequest &, const Model::PutTargetsOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > PutTargetsResponseReceivedHandler
std::function< void(const CloudWatchEventsClient *, const Model::PutRuleRequest &, const Model::PutRuleOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > PutRuleResponseReceivedHandler
std::future< DescribeRuleOutcome > DescribeRuleOutcomeCallable
std::function< void(const CloudWatchEventsClient *, const Model::TestEventPatternRequest &, const Model::TestEventPatternOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > TestEventPatternResponseReceivedHandler
std::future< DisableRuleOutcome > DisableRuleOutcomeCallable
std::function< void(const CloudWatchEventsClient *, const Model::RemoveTargetsRequest &, const Model::RemoveTargetsOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > RemoveTargetsResponseReceivedHandler
std::function< void(const CloudWatchEventsClient *, const Model::DeleteRuleRequest &, const Model::DeleteRuleOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > DeleteRuleResponseReceivedHandler
std::future< ListTargetsByRuleOutcome > ListTargetsByRuleOutcomeCallable
std::function< void(const CloudWatchEventsClient *, const Model::ListRulesRequest &, const Model::ListRulesOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > ListRulesResponseReceivedHandler
std::future< RemoveTargetsOutcome > RemoveTargetsOutcomeCallable
Aws::Utils::Outcome< TestEventPatternResult, Aws::Client::AWSError< CloudWatchEventsErrors > > TestEventPatternOutcome
std::future< ListRuleNamesByTargetOutcome > ListRuleNamesByTargetOutcomeCallable
std::function< void(const CloudWatchEventsClient *, const Model::EnableRuleRequest &, const Model::EnableRuleOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > EnableRuleResponseReceivedHandler
std::future< EnableRuleOutcome > EnableRuleOutcomeCallable
Aws::Utils::Outcome< PutRuleResult, Aws::Client::AWSError< CloudWatchEventsErrors > > PutRuleOutcome
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
Definition: AWSString.h:97
Aws::Utils::Outcome< DescribeRuleResult, Aws::Client::AWSError< CloudWatchEventsErrors > > DescribeRuleOutcome
JSON (JavaScript Object Notation).
Aws::Utils::Outcome< NoResult, Aws::Client::AWSError< CloudWatchEventsErrors > > EnableRuleOutcome