AWS SDK for C++

AWS SDK for C++ Version 1.11.440

Loading...
Searching...
No Matches
InvokeWithResponseStreamHandler.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/lambda/Lambda_EXPORTS.h>
11#include <aws/lambda/LambdaErrors.h>
12
13#include <aws/lambda/model/InvokeWithResponseStreamInitialResponse.h>
14#include <aws/lambda/model/InvokeResponseStreamUpdate.h>
15#include <aws/lambda/model/InvokeWithResponseStreamCompleteEvent.h>
16
17namespace Aws
18{
19namespace Lambda
20{
21namespace Model
22{
24 {
29 };
30
32 {
33 typedef std::function<void(const InvokeWithResponseStreamInitialResponse&)> InvokeWithResponseStreamInitialResponseCallback;
34 typedef std::function<void(const InvokeWithResponseStreamInitialResponse&, const Utils::Event::InitialResponseType)> InvokeWithResponseStreamInitialResponseCallbackEx;
35 typedef std::function<void(const InvokeResponseStreamUpdate&)> InvokeResponseStreamUpdateCallback;
36 typedef std::function<void(const InvokeWithResponseStreamCompleteEvent&)> InvokeWithResponseStreamCompleteEventCallback;
37 typedef std::function<void(const Aws::Client::AWSError<LambdaErrors>& error)> ErrorCallback;
38
39 public:
42
43 AWS_LAMBDA_API virtual void OnEvent() override;
44
46
52 inline void SetInitialResponseCallbackEx(const InvokeWithResponseStreamInitialResponseCallbackEx& callback) { m_onInitialResponse = callback; }
56 inline void SetInitialResponseCallback(const InvokeWithResponseStreamInitialResponseCallback& noArgCallback)
57 {
58 m_onInitialResponse = [noArgCallback](const InvokeWithResponseStreamInitialResponse& rs, const Utils::Event::InitialResponseType) { return noArgCallback(rs); };
59 }
61 inline void SetInvokeResponseStreamUpdateCallback(const InvokeResponseStreamUpdateCallback& callback) { m_onInvokeResponseStreamUpdate = callback; }
62 inline void SetInvokeWithResponseStreamCompleteEventCallback(const InvokeWithResponseStreamCompleteEventCallback& callback) { m_onInvokeWithResponseStreamCompleteEvent = callback; }
63 inline void SetOnErrorCallback(const ErrorCallback& callback) { m_onError = callback; }
64
65 inline InvokeWithResponseStreamInitialResponseCallbackEx& GetInitialResponseCallbackEx() { return m_onInitialResponse; }
66
67 private:
68 AWS_LAMBDA_API void HandleEventInMessage();
69 AWS_LAMBDA_API void HandleErrorInMessage();
70 AWS_LAMBDA_API void MarshallError(const Aws::String& errorCode, const Aws::String& errorMessage);
71
72 InvokeWithResponseStreamInitialResponseCallbackEx m_onInitialResponse;
73 InvokeResponseStreamUpdateCallback m_onInvokeResponseStreamUpdate;
74 InvokeWithResponseStreamCompleteEventCallback m_onInvokeWithResponseStreamCompleteEvent;
75 ErrorCallback m_onError;
76 };
77
78namespace InvokeWithResponseStreamEventMapper
79{
81
83} // namespace InvokeWithResponseStreamEventMapper
84} // namespace Model
85} // namespace Lambda
86} // namespace Aws
void SetInitialResponseCallback(const InvokeWithResponseStreamInitialResponseCallback &noArgCallback)
void SetInitialResponseCallbackEx(const InvokeWithResponseStreamInitialResponseCallbackEx &callback)
InvokeWithResponseStreamInitialResponseCallbackEx & GetInitialResponseCallbackEx()
AWS_LAMBDA_API InvokeWithResponseStreamHandler & operator=(const InvokeWithResponseStreamHandler &)=default
void SetInvokeResponseStreamUpdateCallback(const InvokeResponseStreamUpdateCallback &callback)
virtual AWS_LAMBDA_API void OnEvent() override
void SetInvokeWithResponseStreamCompleteEventCallback(const InvokeWithResponseStreamCompleteEventCallback &callback)
AWS_LAMBDA_API Aws::String GetNameForInvokeWithResponseStreamEventType(InvokeWithResponseStreamEventType value)
AWS_LAMBDA_API InvokeWithResponseStreamEventType GetInvokeWithResponseStreamEventTypeForName(const Aws::String &name)
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String