AWS SDK for C++

AWS SDK for C++ Version 1.11.440

Loading...
Searching...
No Matches
StartStreamTranscriptionHandler.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/transcribestreaming/TranscribeStreamingService_EXPORTS.h>
11#include <aws/transcribestreaming/TranscribeStreamingServiceErrors.h>
12
13#include <aws/transcribestreaming/model/StartStreamTranscriptionInitialResponse.h>
14#include <aws/transcribestreaming/model/TranscriptEvent.h>
15
16namespace Aws
17{
18namespace TranscribeStreamingService
19{
20namespace Model
21{
23 {
27 };
28
30 {
31 typedef std::function<void(const StartStreamTranscriptionInitialResponse&)> StartStreamTranscriptionInitialResponseCallback;
32 typedef std::function<void(const StartStreamTranscriptionInitialResponse&, const Utils::Event::InitialResponseType)> StartStreamTranscriptionInitialResponseCallbackEx;
33 typedef std::function<void(const TranscriptEvent&)> TranscriptEventCallback;
34 typedef std::function<void(const Aws::Client::AWSError<TranscribeStreamingServiceErrors>& error)> ErrorCallback;
35
36 public:
37 AWS_TRANSCRIBESTREAMINGSERVICE_API StartStreamTranscriptionHandler();
38 AWS_TRANSCRIBESTREAMINGSERVICE_API StartStreamTranscriptionHandler& operator=(const StartStreamTranscriptionHandler&) = default;
39
40 AWS_TRANSCRIBESTREAMINGSERVICE_API virtual void OnEvent() override;
41
43
49 inline void SetInitialResponseCallbackEx(const StartStreamTranscriptionInitialResponseCallbackEx& callback) { m_onInitialResponse = callback; }
53 inline void SetInitialResponseCallback(const StartStreamTranscriptionInitialResponseCallback& noArgCallback)
54 {
55 m_onInitialResponse = [noArgCallback](const StartStreamTranscriptionInitialResponse& rs, const Utils::Event::InitialResponseType) { return noArgCallback(rs); };
56 }
58 inline void SetTranscriptEventCallback(const TranscriptEventCallback& callback) { m_onTranscriptEvent = callback; }
59 inline void SetOnErrorCallback(const ErrorCallback& callback) { m_onError = callback; }
60
61 inline StartStreamTranscriptionInitialResponseCallbackEx& GetInitialResponseCallbackEx() { return m_onInitialResponse; }
62
63 private:
64 AWS_TRANSCRIBESTREAMINGSERVICE_API void HandleEventInMessage();
65 AWS_TRANSCRIBESTREAMINGSERVICE_API void HandleErrorInMessage();
66 AWS_TRANSCRIBESTREAMINGSERVICE_API void MarshallError(const Aws::String& errorCode, const Aws::String& errorMessage);
67
68 StartStreamTranscriptionInitialResponseCallbackEx m_onInitialResponse;
69 TranscriptEventCallback m_onTranscriptEvent;
70 ErrorCallback m_onError;
71 };
72
73namespace StartStreamTranscriptionEventMapper
74{
76
78} // namespace StartStreamTranscriptionEventMapper
79} // namespace Model
80} // namespace TranscribeStreamingService
81} // namespace Aws
void SetInitialResponseCallbackEx(const StartStreamTranscriptionInitialResponseCallbackEx &callback)
void SetInitialResponseCallback(const StartStreamTranscriptionInitialResponseCallback &noArgCallback)
StartStreamTranscriptionInitialResponseCallbackEx & GetInitialResponseCallbackEx()
virtual AWS_TRANSCRIBESTREAMINGSERVICE_API void OnEvent() override
AWS_TRANSCRIBESTREAMINGSERVICE_API StartStreamTranscriptionHandler & operator=(const StartStreamTranscriptionHandler &)=default
AWS_TRANSCRIBESTREAMINGSERVICE_API StartStreamTranscriptionEventType GetStartStreamTranscriptionEventTypeForName(const Aws::String &name)
AWS_TRANSCRIBESTREAMINGSERVICE_API Aws::String GetNameForStartStreamTranscriptionEventType(StartStreamTranscriptionEventType value)
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String