AWS SDK for C++

AWS SDK for C++ Version 1.11.740

Loading...
Searching...
No Matches
ChatRequest.h
1
6#pragma once
7#include <aws/core/utils/UUID.h>
8#include <aws/core/utils/event/EventStreamDecoder.h>
9#include <aws/core/utils/memory/stl/AWSString.h>
10#include <aws/core/utils/memory/stl/AWSVector.h>
11#include <aws/qbusiness/QBusinessRequest.h>
12#include <aws/qbusiness/QBusiness_EXPORTS.h>
13#include <aws/qbusiness/model/ChatHandler.h>
14#include <aws/qbusiness/model/ChatInputStream.h>
15
16#include <memory>
17#include <utility>
18
19namespace Aws {
20namespace Http {
21class URI;
22} // namespace Http
23namespace QBusiness {
24namespace Model {
25
29 public:
30 AWS_QBUSINESS_API ChatRequest() = default;
31
32 // Service request name is the Operation name which will send this request out,
33 // each operation should has unique request name, so that we can get operation's name from this request.
34 // Note: this is not true for response, multiple operations may have the same response name,
35 // so we can not get operation's name from response.
36 inline virtual const char* GetServiceRequestName() const override { return "Chat"; }
37
38 inline virtual bool IsEventStreamRequest() const override { return true; }
39 inline virtual bool HasEventStreamResponse() const override { return true; }
40 // SerializePayload will not be invoked.
41 // This request is sent by encoding its data in event-streams which is sent as IOStream via GetBody()
42 AWS_QBUSINESS_API Aws::String SerializePayload() const override { return {}; }
43 AWS_QBUSINESS_API std::shared_ptr<Aws::IOStream> GetBody() const override;
44 AWS_QBUSINESS_API void AddQueryStringParameters(Aws::Http::URI& uri) const override;
45
50
54 inline ChatHandler& GetEventStreamHandler() { return m_handler; }
55
59 inline void SetEventStreamHandler(const ChatHandler& value) {
60 m_handler = value;
61 m_decoder.ResetEventStreamHandler(&m_handler);
62 }
63
69 return *this;
70 }
71
73
77 inline const Aws::String& GetApplicationId() const { return m_applicationId; }
78 inline bool ApplicationIdHasBeenSet() const { return m_applicationIdHasBeenSet; }
79 template <typename ApplicationIdT = Aws::String>
81 m_applicationIdHasBeenSet = true;
82 m_applicationId = std::forward<ApplicationIdT>(value);
83 }
84 template <typename ApplicationIdT = Aws::String>
86 SetApplicationId(std::forward<ApplicationIdT>(value));
87 return *this;
88 }
90
92
95 inline const Aws::String& GetUserId() const { return m_userId; }
96 inline bool UserIdHasBeenSet() const { return m_userIdHasBeenSet; }
97 template <typename UserIdT = Aws::String>
98 void SetUserId(UserIdT&& value) {
99 m_userIdHasBeenSet = true;
100 m_userId = std::forward<UserIdT>(value);
101 }
102 template <typename UserIdT = Aws::String>
104 SetUserId(std::forward<UserIdT>(value));
105 return *this;
106 }
108
110
113 inline const Aws::Vector<Aws::String>& GetUserGroups() const { return m_userGroups; }
114 inline bool UserGroupsHasBeenSet() const { return m_userGroupsHasBeenSet; }
115 template <typename UserGroupsT = Aws::Vector<Aws::String>>
117 m_userGroupsHasBeenSet = true;
118 m_userGroups = std::forward<UserGroupsT>(value);
119 }
120 template <typename UserGroupsT = Aws::Vector<Aws::String>>
122 SetUserGroups(std::forward<UserGroupsT>(value));
123 return *this;
124 }
125 template <typename UserGroupsT = Aws::String>
127 m_userGroupsHasBeenSet = true;
128 m_userGroups.emplace_back(std::forward<UserGroupsT>(value));
129 return *this;
130 }
132
134
137 inline const Aws::String& GetConversationId() const { return m_conversationId; }
138 inline bool ConversationIdHasBeenSet() const { return m_conversationIdHasBeenSet; }
139 template <typename ConversationIdT = Aws::String>
141 m_conversationIdHasBeenSet = true;
142 m_conversationId = std::forward<ConversationIdT>(value);
143 }
144 template <typename ConversationIdT = Aws::String>
146 SetConversationId(std::forward<ConversationIdT>(value));
147 return *this;
148 }
150
152
156 inline const Aws::String& GetParentMessageId() const { return m_parentMessageId; }
157 inline bool ParentMessageIdHasBeenSet() const { return m_parentMessageIdHasBeenSet; }
158 template <typename ParentMessageIdT = Aws::String>
160 m_parentMessageIdHasBeenSet = true;
161 m_parentMessageId = std::forward<ParentMessageIdT>(value);
162 }
163 template <typename ParentMessageIdT = Aws::String>
165 SetParentMessageId(std::forward<ParentMessageIdT>(value));
166 return *this;
167 }
169
171
174 inline const Aws::String& GetClientToken() const { return m_clientToken; }
175 inline bool ClientTokenHasBeenSet() const { return m_clientTokenHasBeenSet; }
176 template <typename ClientTokenT = Aws::String>
178 m_clientTokenHasBeenSet = true;
179 m_clientToken = std::forward<ClientTokenT>(value);
180 }
181 template <typename ClientTokenT = Aws::String>
183 SetClientToken(std::forward<ClientTokenT>(value));
184 return *this;
185 }
187
189
192 AWS_QBUSINESS_API std::shared_ptr<ChatInputStream> GetInputStream() const { return m_inputStream; }
193 AWS_QBUSINESS_API void SetInputStream(const std::shared_ptr<ChatInputStream>& value) {
194 m_inputStreamHasBeenSet = true;
195 m_inputStream = value;
196 }
197 AWS_QBUSINESS_API ChatRequest& WithInputStream(const std::shared_ptr<ChatInputStream>& value) {
198 SetInputStream(value);
199 return *this;
200 }
201
203 private:
204 Aws::String m_applicationId;
205
206 Aws::String m_userId;
207
208 Aws::Vector<Aws::String> m_userGroups;
209
210 Aws::String m_conversationId;
211
212 Aws::String m_parentMessageId;
213
215
216 std::shared_ptr<ChatInputStream> m_inputStream;
217 ChatHandler m_handler;
219
220 bool m_applicationIdHasBeenSet = false;
221 bool m_userIdHasBeenSet = false;
222 bool m_userGroupsHasBeenSet = false;
223 bool m_conversationIdHasBeenSet = false;
224 bool m_parentMessageIdHasBeenSet = false;
225 bool m_clientTokenHasBeenSet = true;
226 bool m_inputStreamHasBeenSet = false;
227};
228
229} // namespace Model
230} // namespace QBusiness
231} // namespace Aws
ChatRequest & AddUserGroups(UserGroupsT &&value)
ChatRequest & WithEventStreamHandler(const ChatHandler &value)
Definition ChatRequest.h:67
ChatRequest & WithParentMessageId(ParentMessageIdT &&value)
const Aws::String & GetUserId() const
Definition ChatRequest.h:95
const Aws::Vector< Aws::String > & GetUserGroups() const
ChatRequest & WithApplicationId(ApplicationIdT &&value)
Definition ChatRequest.h:85
AWS_QBUSINESS_API std::shared_ptr< ChatInputStream > GetInputStream() const
void SetConversationId(ConversationIdT &&value)
AWS_QBUSINESS_API void SetInputStream(const std::shared_ptr< ChatInputStream > &value)
const Aws::String & GetConversationId() const
const Aws::String & GetParentMessageId() const
AWS_QBUSINESS_API std::shared_ptr< Aws::IOStream > GetBody() const override
void SetApplicationId(ApplicationIdT &&value)
Definition ChatRequest.h:80
const Aws::String & GetApplicationId() const
Definition ChatRequest.h:77
Aws::Utils::Event::EventStreamDecoder & GetEventStreamDecoder()
Definition ChatRequest.h:49
virtual bool IsEventStreamRequest() const override
Definition ChatRequest.h:38
ChatRequest & WithClientToken(ClientTokenT &&value)
AWS_QBUSINESS_API void AddQueryStringParameters(Aws::Http::URI &uri) const override
virtual bool HasEventStreamResponse() const override
Definition ChatRequest.h:39
virtual const char * GetServiceRequestName() const override
Definition ChatRequest.h:36
const Aws::String & GetClientToken() const
ChatRequest & WithUserGroups(UserGroupsT &&value)
AWS_QBUSINESS_API ChatRequest()=default
AWS_QBUSINESS_API ChatRequest & WithInputStream(const std::shared_ptr< ChatInputStream > &value)
void SetClientToken(ClientTokenT &&value)
void SetEventStreamHandler(const ChatHandler &value)
Definition ChatRequest.h:59
void SetParentMessageId(ParentMessageIdT &&value)
AWS_QBUSINESS_API Aws::String SerializePayload() const override
Definition ChatRequest.h:42
ChatRequest & WithConversationId(ConversationIdT &&value)
ChatRequest & WithUserId(UserIdT &&value)
void SetUserId(UserIdT &&value)
Definition ChatRequest.h:98
void SetUserGroups(UserGroupsT &&value)
void ResetEventStreamHandler(EventStreamHandler *handler)
static Aws::Utils::UUID PseudoRandomUUID()
std::shared_ptr< T > MakeShared(const char *allocationTag, ArgTypes &&... args)
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
std::vector< T, Aws::Allocator< T > > Vector