AWS SDK for C++

AWS SDK for C++ Version 1.11.440

Loading...
Searching...
No Matches
StartLiveTailHandler.h
1
6#pragma once
7#include <aws/core/utils/HashingUtils.h>
8#include <aws/core/utils/event/EventStreamHandler.h>
9#include <aws/core/client/AWSError.h>
10#include <aws/logs/CloudWatchLogs_EXPORTS.h>
11#include <aws/logs/CloudWatchLogsErrors.h>
12
13#include <aws/logs/model/StartLiveTailInitialResponse.h>
14#include <aws/logs/model/LiveTailSessionStart.h>
15#include <aws/logs/model/LiveTailSessionUpdate.h>
16
17namespace Aws
18{
19namespace CloudWatchLogs
20{
21namespace Model
22{
24 {
29 };
30
32 {
33 typedef std::function<void(const StartLiveTailInitialResponse&)> StartLiveTailInitialResponseCallback;
34 typedef std::function<void(const StartLiveTailInitialResponse&, const Utils::Event::InitialResponseType)> StartLiveTailInitialResponseCallbackEx;
35 typedef std::function<void(const LiveTailSessionStart&)> LiveTailSessionStartCallback;
36 typedef std::function<void(const LiveTailSessionUpdate&)> LiveTailSessionUpdateCallback;
37 typedef std::function<void(const Aws::Client::AWSError<CloudWatchLogsErrors>& error)> ErrorCallback;
38
39 public:
40 AWS_CLOUDWATCHLOGS_API StartLiveTailHandler();
41 AWS_CLOUDWATCHLOGS_API StartLiveTailHandler& operator=(const StartLiveTailHandler&) = default;
42
43 AWS_CLOUDWATCHLOGS_API virtual void OnEvent() override;
44
46
52 inline void SetInitialResponseCallbackEx(const StartLiveTailInitialResponseCallbackEx& callback) { m_onInitialResponse = callback; }
56 inline void SetInitialResponseCallback(const StartLiveTailInitialResponseCallback& noArgCallback)
57 {
58 m_onInitialResponse = [noArgCallback](const StartLiveTailInitialResponse& rs, const Utils::Event::InitialResponseType) { return noArgCallback(rs); };
59 }
61 inline void SetLiveTailSessionStartCallback(const LiveTailSessionStartCallback& callback) { m_onLiveTailSessionStart = callback; }
62 inline void SetLiveTailSessionUpdateCallback(const LiveTailSessionUpdateCallback& callback) { m_onLiveTailSessionUpdate = callback; }
63 inline void SetOnErrorCallback(const ErrorCallback& callback) { m_onError = callback; }
64
65 inline StartLiveTailInitialResponseCallbackEx& GetInitialResponseCallbackEx() { return m_onInitialResponse; }
66
67 private:
68 AWS_CLOUDWATCHLOGS_API void HandleEventInMessage();
69 AWS_CLOUDWATCHLOGS_API void HandleErrorInMessage();
70 AWS_CLOUDWATCHLOGS_API void MarshallError(const Aws::String& errorCode, const Aws::String& errorMessage);
71
72 StartLiveTailInitialResponseCallbackEx m_onInitialResponse;
73 LiveTailSessionStartCallback m_onLiveTailSessionStart;
74 LiveTailSessionUpdateCallback m_onLiveTailSessionUpdate;
75 ErrorCallback m_onError;
76 };
77
78namespace StartLiveTailEventMapper
79{
81
83} // namespace StartLiveTailEventMapper
84} // namespace Model
85} // namespace CloudWatchLogs
86} // namespace Aws
StartLiveTailInitialResponseCallbackEx & GetInitialResponseCallbackEx()
void SetInitialResponseCallbackEx(const StartLiveTailInitialResponseCallbackEx &callback)
virtual AWS_CLOUDWATCHLOGS_API void OnEvent() override
void SetLiveTailSessionUpdateCallback(const LiveTailSessionUpdateCallback &callback)
AWS_CLOUDWATCHLOGS_API StartLiveTailHandler & operator=(const StartLiveTailHandler &)=default
void SetInitialResponseCallback(const StartLiveTailInitialResponseCallback &noArgCallback)
void SetOnErrorCallback(const ErrorCallback &callback)
void SetLiveTailSessionStartCallback(const LiveTailSessionStartCallback &callback)
AWS_CLOUDWATCHLOGS_API Aws::String GetNameForStartLiveTailEventType(StartLiveTailEventType value)
AWS_CLOUDWATCHLOGS_API StartLiveTailEventType GetStartLiveTailEventTypeForName(const Aws::String &name)
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String