AWS SDK for C++

AWS SDK for C++ Version 1.11.943

Loading...
Searching...
No Matches
ChatEventStream.h
1
6#pragma once
7#include <aws/assurance/Assurance_EXPORTS.h>
8#include <aws/assurance/model/ChatChunkEvent.h>
9#include <aws/assurance/model/ChatErrorEvent.h>
10#include <aws/assurance/model/ChatResponseEvent.h>
11#include <aws/assurance/model/ChatToolCallEvent.h>
12#include <aws/crt/cbor/Cbor.h>
13
14#include <utility>
15
16namespace Aws {
17namespace Utils {
18namespace Cbor {
19class CborValue;
20} // namespace Cbor
21} // namespace Utils
22namespace Assurance {
23namespace Model {
24
32 public:
33 AWS_ASSURANCE_API ChatEventStream() = default;
34 AWS_ASSURANCE_API ChatEventStream(const std::shared_ptr<Aws::Crt::Cbor::CborDecoder>& decoder);
35 AWS_ASSURANCE_API ChatEventStream& operator=(const std::shared_ptr<Aws::Crt::Cbor::CborDecoder>& decoder);
36 AWS_ASSURANCE_API void CborEncode(Aws::Crt::Cbor::CborEncoder& encoder) const;
37
39
42 inline const ChatChunkEvent& GetChunk() const { return m_chunk; }
43 inline bool ChunkHasBeenSet() const { return m_chunkHasBeenSet; }
44 template <typename ChunkT = ChatChunkEvent>
45 void SetChunk(ChunkT&& value) {
46 m_chunkHasBeenSet = true;
47 m_chunk = std::forward<ChunkT>(value);
48 }
49 template <typename ChunkT = ChatChunkEvent>
50 ChatEventStream& WithChunk(ChunkT&& value) {
51 SetChunk(std::forward<ChunkT>(value));
52 return *this;
53 }
55
57
60 inline const ChatToolCallEvent& GetToolCall() const { return m_toolCall; }
61 inline bool ToolCallHasBeenSet() const { return m_toolCallHasBeenSet; }
62 template <typename ToolCallT = ChatToolCallEvent>
63 void SetToolCall(ToolCallT&& value) {
64 m_toolCallHasBeenSet = true;
65 m_toolCall = std::forward<ToolCallT>(value);
66 }
67 template <typename ToolCallT = ChatToolCallEvent>
68 ChatEventStream& WithToolCall(ToolCallT&& value) {
69 SetToolCall(std::forward<ToolCallT>(value));
70 return *this;
71 }
73
75
79 inline const ChatResponseEvent& GetResponse() const { return m_response; }
80 inline bool ResponseHasBeenSet() const { return m_responseHasBeenSet; }
81 template <typename ResponseT = ChatResponseEvent>
82 void SetResponse(ResponseT&& value) {
83 m_responseHasBeenSet = true;
84 m_response = std::forward<ResponseT>(value);
85 }
86 template <typename ResponseT = ChatResponseEvent>
87 ChatEventStream& WithResponse(ResponseT&& value) {
88 SetResponse(std::forward<ResponseT>(value));
89 return *this;
90 }
92
94
99 inline const ChatErrorEvent& GetError() const { return m_error; }
100 inline bool ErrorHasBeenSet() const { return m_errorHasBeenSet; }
101 template <typename ErrorT = ChatErrorEvent>
102 void SetError(ErrorT&& value) {
103 m_errorHasBeenSet = true;
104 m_error = std::forward<ErrorT>(value);
105 }
106 template <typename ErrorT = ChatErrorEvent>
107 ChatEventStream& WithError(ErrorT&& value) {
108 SetError(std::forward<ErrorT>(value));
109 return *this;
110 }
112 private:
113 ChatChunkEvent m_chunk;
114
115 ChatToolCallEvent m_toolCall;
116
117 ChatResponseEvent m_response;
118
119 ChatErrorEvent m_error;
120 bool m_chunkHasBeenSet = false;
121 bool m_toolCallHasBeenSet = false;
122 bool m_responseHasBeenSet = false;
123 bool m_errorHasBeenSet = false;
124};
125
126} // namespace Model
127} // namespace Assurance
128} // namespace Aws
const ChatResponseEvent & GetResponse() const
ChatEventStream & WithChunk(ChunkT &&value)
ChatEventStream & WithResponse(ResponseT &&value)
AWS_ASSURANCE_API ChatEventStream(const std::shared_ptr< Aws::Crt::Cbor::CborDecoder > &decoder)
const ChatToolCallEvent & GetToolCall() const
AWS_ASSURANCE_API void CborEncode(Aws::Crt::Cbor::CborEncoder &encoder) const
const ChatChunkEvent & GetChunk() const
AWS_ASSURANCE_API ChatEventStream & operator=(const std::shared_ptr< Aws::Crt::Cbor::CborDecoder > &decoder)
ChatEventStream & WithError(ErrorT &&value)
AWS_ASSURANCE_API ChatEventStream()=default
const ChatErrorEvent & GetError() const
ChatEventStream & WithToolCall(ToolCallT &&value)