AWS SDK for C++  0.12.9
AWS SDK for C++
CloudTrailClient.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
37 #include <future>
38 #include <functional>
39 
40 namespace Aws
41 {
42 
43 namespace Http
44 {
45  class HttpClient;
46  class HttpClientFactory;
47 } // namespace Http
48 
49 namespace Utils
50 {
51  template< typename R, typename E> class Outcome;
52 
53 namespace Threading
54 {
55  class Executor;
56 } // namespace Threading
57 
58 namespace Json
59 {
60  class JsonValue;
61 } // namespace Json
62 } // namespace Utils
63 
64 namespace Auth
65 {
66  class AWSCredentials;
67  class AWSCredentialsProvider;
68 } // namespace Auth
69 
70 namespace Client
71 {
72  class RetryStrategy;
73 } // namespace Client
74 
75 namespace CloudTrail
76 {
77 
78 namespace Model
79 {
80  class AddTagsRequest;
81  class CreateTrailRequest;
82  class DeleteTrailRequest;
86  class ListTagsRequest;
87  class LookupEventsRequest;
88  class RemoveTagsRequest;
89  class StartLoggingRequest;
90  class StopLoggingRequest;
92 
105 
106  typedef std::future<AddTagsOutcome> AddTagsOutcomeCallable;
107  typedef std::future<CreateTrailOutcome> CreateTrailOutcomeCallable;
108  typedef std::future<DeleteTrailOutcome> DeleteTrailOutcomeCallable;
109  typedef std::future<DescribeTrailsOutcome> DescribeTrailsOutcomeCallable;
110  typedef std::future<GetTrailStatusOutcome> GetTrailStatusOutcomeCallable;
111  typedef std::future<ListPublicKeysOutcome> ListPublicKeysOutcomeCallable;
112  typedef std::future<ListTagsOutcome> ListTagsOutcomeCallable;
113  typedef std::future<LookupEventsOutcome> LookupEventsOutcomeCallable;
114  typedef std::future<RemoveTagsOutcome> RemoveTagsOutcomeCallable;
115  typedef std::future<StartLoggingOutcome> StartLoggingOutcomeCallable;
116  typedef std::future<StopLoggingOutcome> StopLoggingOutcomeCallable;
117  typedef std::future<UpdateTrailOutcome> UpdateTrailOutcomeCallable;
118 } // namespace Model
119 
121 
122  typedef std::function<void(const CloudTrailClient*, const Model::AddTagsRequest&, const Model::AddTagsOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > AddTagsResponseReceivedHandler;
123  typedef std::function<void(const CloudTrailClient*, const Model::CreateTrailRequest&, const Model::CreateTrailOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > CreateTrailResponseReceivedHandler;
124  typedef std::function<void(const CloudTrailClient*, const Model::DeleteTrailRequest&, const Model::DeleteTrailOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DeleteTrailResponseReceivedHandler;
125  typedef std::function<void(const CloudTrailClient*, const Model::DescribeTrailsRequest&, const Model::DescribeTrailsOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DescribeTrailsResponseReceivedHandler;
126  typedef std::function<void(const CloudTrailClient*, const Model::GetTrailStatusRequest&, const Model::GetTrailStatusOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > GetTrailStatusResponseReceivedHandler;
127  typedef std::function<void(const CloudTrailClient*, const Model::ListPublicKeysRequest&, const Model::ListPublicKeysOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > ListPublicKeysResponseReceivedHandler;
128  typedef std::function<void(const CloudTrailClient*, const Model::ListTagsRequest&, const Model::ListTagsOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > ListTagsResponseReceivedHandler;
129  typedef std::function<void(const CloudTrailClient*, const Model::LookupEventsRequest&, const Model::LookupEventsOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > LookupEventsResponseReceivedHandler;
130  typedef std::function<void(const CloudTrailClient*, const Model::RemoveTagsRequest&, const Model::RemoveTagsOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > RemoveTagsResponseReceivedHandler;
131  typedef std::function<void(const CloudTrailClient*, const Model::StartLoggingRequest&, const Model::StartLoggingOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > StartLoggingResponseReceivedHandler;
132  typedef std::function<void(const CloudTrailClient*, const Model::StopLoggingRequest&, const Model::StopLoggingOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > StopLoggingResponseReceivedHandler;
133  typedef std::function<void(const CloudTrailClient*, const Model::UpdateTrailRequest&, const Model::UpdateTrailOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > UpdateTrailResponseReceivedHandler;
134 
154  {
155  public:
157 
163 
168  CloudTrailClient(const Auth::AWSCredentials& credentials, const Client::ClientConfiguration& clientConfiguration = Client::ClientConfiguration());
169 
174  CloudTrailClient(const std::shared_ptr<Auth::AWSCredentialsProvider>& credentialsProvider,
175  const Client::ClientConfiguration& clientConfiguration = Client::ClientConfiguration());
176 
177  virtual ~CloudTrailClient();
178 
187  virtual Model::AddTagsOutcome AddTags(const Model::AddTagsRequest& request) const;
188 
199  virtual Model::AddTagsOutcomeCallable AddTagsCallable(const Model::AddTagsRequest& request) const;
200 
211  virtual void AddTagsAsync(const Model::AddTagsRequest& request, const AddTagsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
212 
218  virtual Model::CreateTrailOutcome CreateTrail(const Model::CreateTrailRequest& request) const;
219 
227  virtual Model::CreateTrailOutcomeCallable CreateTrailCallable(const Model::CreateTrailRequest& request) const;
228 
236  virtual void CreateTrailAsync(const Model::CreateTrailRequest& request, const CreateTrailResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
237 
244  virtual Model::DeleteTrailOutcome DeleteTrail(const Model::DeleteTrailRequest& request) const;
245 
254  virtual Model::DeleteTrailOutcomeCallable DeleteTrailCallable(const Model::DeleteTrailRequest& request) const;
255 
264  virtual void DeleteTrailAsync(const Model::DeleteTrailRequest& request, const DeleteTrailResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
265 
270  virtual Model::DescribeTrailsOutcome DescribeTrails(const Model::DescribeTrailsRequest& request) const;
271 
278  virtual Model::DescribeTrailsOutcomeCallable DescribeTrailsCallable(const Model::DescribeTrailsRequest& request) const;
279 
286  virtual void DescribeTrailsAsync(const Model::DescribeTrailsRequest& request, const DescribeTrailsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
287 
295  virtual Model::GetTrailStatusOutcome GetTrailStatus(const Model::GetTrailStatusRequest& request) const;
296 
306  virtual Model::GetTrailStatusOutcomeCallable GetTrailStatusCallable(const Model::GetTrailStatusRequest& request) const;
307 
317  virtual void GetTrailStatusAsync(const Model::GetTrailStatusRequest& request, const GetTrailStatusResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
318 
328  virtual Model::ListPublicKeysOutcome ListPublicKeys(const Model::ListPublicKeysRequest& request) const;
329 
341  virtual Model::ListPublicKeysOutcomeCallable ListPublicKeysCallable(const Model::ListPublicKeysRequest& request) const;
342 
354  virtual void ListPublicKeysAsync(const Model::ListPublicKeysRequest& request, const ListPublicKeysResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
355 
359  virtual Model::ListTagsOutcome ListTags(const Model::ListTagsRequest& request) const;
360 
366  virtual Model::ListTagsOutcomeCallable ListTagsCallable(const Model::ListTagsRequest& request) const;
367 
373  virtual void ListTagsAsync(const Model::ListTagsRequest& request, const ListTagsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
374 
391  virtual Model::LookupEventsOutcome LookupEvents(const Model::LookupEventsRequest& request) const;
392 
411  virtual Model::LookupEventsOutcomeCallable LookupEventsCallable(const Model::LookupEventsRequest& request) const;
412 
431  virtual void LookupEventsAsync(const Model::LookupEventsRequest& request, const LookupEventsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
432 
436  virtual Model::RemoveTagsOutcome RemoveTags(const Model::RemoveTagsRequest& request) const;
437 
443  virtual Model::RemoveTagsOutcomeCallable RemoveTagsCallable(const Model::RemoveTagsRequest& request) const;
444 
450  virtual void RemoveTagsAsync(const Model::RemoveTagsRequest& request, const RemoveTagsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
451 
459  virtual Model::StartLoggingOutcome StartLogging(const Model::StartLoggingRequest& request) const;
460 
470  virtual Model::StartLoggingOutcomeCallable StartLoggingCallable(const Model::StartLoggingRequest& request) const;
471 
481  virtual void StartLoggingAsync(const Model::StartLoggingRequest& request, const StartLoggingResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
482 
493  virtual Model::StopLoggingOutcome StopLogging(const Model::StopLoggingRequest& request) const;
494 
507  virtual Model::StopLoggingOutcomeCallable StopLoggingCallable(const Model::StopLoggingRequest& request) const;
508 
521  virtual void StopLoggingAsync(const Model::StopLoggingRequest& request, const StopLoggingResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
522 
531  virtual Model::UpdateTrailOutcome UpdateTrail(const Model::UpdateTrailRequest& request) const;
532 
543  virtual Model::UpdateTrailOutcomeCallable UpdateTrailCallable(const Model::UpdateTrailRequest& request) const;
544 
555  virtual void UpdateTrailAsync(const Model::UpdateTrailRequest& request, const UpdateTrailResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
556 
557 
558  private:
559  void init(const Client::ClientConfiguration& clientConfiguration);
560 
562  void AddTagsAsyncHelper(const Model::AddTagsRequest& request, const AddTagsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
563  void CreateTrailAsyncHelper(const Model::CreateTrailRequest& request, const CreateTrailResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
564  void DeleteTrailAsyncHelper(const Model::DeleteTrailRequest& request, const DeleteTrailResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
565  void DescribeTrailsAsyncHelper(const Model::DescribeTrailsRequest& request, const DescribeTrailsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
566  void GetTrailStatusAsyncHelper(const Model::GetTrailStatusRequest& request, const GetTrailStatusResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
567  void ListPublicKeysAsyncHelper(const Model::ListPublicKeysRequest& request, const ListPublicKeysResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
568  void ListTagsAsyncHelper(const Model::ListTagsRequest& request, const ListTagsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
569  void LookupEventsAsyncHelper(const Model::LookupEventsRequest& request, const LookupEventsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
570  void RemoveTagsAsyncHelper(const Model::RemoveTagsRequest& request, const RemoveTagsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
571  void StartLoggingAsyncHelper(const Model::StartLoggingRequest& request, const StartLoggingResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
572  void StopLoggingAsyncHelper(const Model::StopLoggingRequest& request, const StopLoggingResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
573  void UpdateTrailAsyncHelper(const Model::UpdateTrailRequest& request, const UpdateTrailResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
574 
575  Aws::String m_uri;
576  std::shared_ptr<Utils::Threading::Executor> m_executor;
577  };
578 
579 } // namespace CloudTrail
580 } // namespace Aws
std::function< void(const CloudTrailClient *, const Model::UpdateTrailRequest &, const Model::UpdateTrailOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > UpdateTrailResponseReceivedHandler
std::function< void(const CloudTrailClient *, const Model::ListTagsRequest &, const Model::ListTagsOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > ListTagsResponseReceivedHandler
std::future< ListTagsOutcome > ListTagsOutcomeCallable
std::future< LookupEventsOutcome > LookupEventsOutcomeCallable
std::function< void(const CloudTrailClient *, const Model::GetTrailStatusRequest &, const Model::GetTrailStatusOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > GetTrailStatusResponseReceivedHandler
std::function< void(const CloudTrailClient *, const Model::ListPublicKeysRequest &, const Model::ListPublicKeysOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > ListPublicKeysResponseReceivedHandler
std::function< void(const CloudTrailClient *, const Model::DeleteTrailRequest &, const Model::DeleteTrailOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > DeleteTrailResponseReceivedHandler
std::future< GetTrailStatusOutcome > GetTrailStatusOutcomeCallable
Aws::Utils::Outcome< ListTagsResult, Aws::Client::AWSError< CloudTrailErrors > > ListTagsOutcome
std::function< void(const CloudTrailClient *, const Model::AddTagsRequest &, const Model::AddTagsOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > AddTagsResponseReceivedHandler
std::future< DescribeTrailsOutcome > DescribeTrailsOutcomeCallable
std::future< AddTagsOutcome > AddTagsOutcomeCallable
Aws::Utils::Outcome< GetTrailStatusResult, Aws::Client::AWSError< CloudTrailErrors > > GetTrailStatusOutcome
Aws::Utils::Outcome< StopLoggingResult, Aws::Client::AWSError< CloudTrailErrors > > StopLoggingOutcome
Aws::Utils::Outcome< CreateTrailResult, Aws::Client::AWSError< CloudTrailErrors > > CreateTrailOutcome
std::future< DeleteTrailOutcome > DeleteTrailOutcomeCallable
std::future< ListPublicKeysOutcome > ListPublicKeysOutcomeCallable
Aws::Utils::Outcome< StartLoggingResult, Aws::Client::AWSError< CloudTrailErrors > > StartLoggingOutcome
std::future< CreateTrailOutcome > CreateTrailOutcomeCallable
Aws::Utils::Outcome< DescribeTrailsResult, Aws::Client::AWSError< CloudTrailErrors > > DescribeTrailsOutcome
Aws::Utils::Outcome< DeleteTrailResult, Aws::Client::AWSError< CloudTrailErrors > > DeleteTrailOutcome
Aws::Utils::Outcome< RemoveTagsResult, Aws::Client::AWSError< CloudTrailErrors > > RemoveTagsOutcome
std::function< void(const CloudTrailClient *, const Model::CreateTrailRequest &, const Model::CreateTrailOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > CreateTrailResponseReceivedHandler
std::future< RemoveTagsOutcome > RemoveTagsOutcomeCallable
std::function< void(const CloudTrailClient *, const Model::LookupEventsRequest &, const Model::LookupEventsOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > LookupEventsResponseReceivedHandler
Aws::Utils::Outcome< ListPublicKeysResult, Aws::Client::AWSError< CloudTrailErrors > > ListPublicKeysOutcome
Aws::Utils::Outcome< AddTagsResult, Aws::Client::AWSError< CloudTrailErrors > > AddTagsOutcome
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
Definition: AWSString.h:97
std::function< void(const CloudTrailClient *, const Model::DescribeTrailsRequest &, const Model::DescribeTrailsOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > DescribeTrailsResponseReceivedHandler
Aws::Utils::Outcome< UpdateTrailResult, Aws::Client::AWSError< CloudTrailErrors > > UpdateTrailOutcome
std::function< void(const CloudTrailClient *, const Model::RemoveTagsRequest &, const Model::RemoveTagsOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > RemoveTagsResponseReceivedHandler
#define AWS_CLOUDTRAIL_API
Aws::Client::AWSJsonClient BASECLASS
std::future< UpdateTrailOutcome > UpdateTrailOutcomeCallable
std::future< StartLoggingOutcome > StartLoggingOutcomeCallable
std::function< void(const CloudTrailClient *, const Model::StopLoggingRequest &, const Model::StopLoggingOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > StopLoggingResponseReceivedHandler
std::future< StopLoggingOutcome > StopLoggingOutcomeCallable
Aws::Utils::Outcome< LookupEventsResult, Aws::Client::AWSError< CloudTrailErrors > > LookupEventsOutcome
std::function< void(const CloudTrailClient *, const Model::StartLoggingRequest &, const Model::StartLoggingOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > StartLoggingResponseReceivedHandler
JSON (JavaScript Object Notation).