rivet_client_api_chat/
output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(std::clone::Clone, std::cmp::PartialEq)]
5pub struct GetDirectThreadOutput {
6	/// A universally unique identifier.
7	pub thread_id: std::option::Option<std::string::String>,
8	/// An identity handle.
9	pub identity: std::option::Option<crate::model::IdentityHandle>,
10}
11impl GetDirectThreadOutput {
12	/// A universally unique identifier.
13	pub fn thread_id(&self) -> std::option::Option<&str> {
14		self.thread_id.as_deref()
15	}
16	/// An identity handle.
17	pub fn identity(&self) -> std::option::Option<&crate::model::IdentityHandle> {
18		self.identity.as_ref()
19	}
20}
21impl std::fmt::Debug for GetDirectThreadOutput {
22	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
23		let mut formatter = f.debug_struct("GetDirectThreadOutput");
24		formatter.field("thread_id", &self.thread_id);
25		formatter.field("identity", &self.identity);
26		formatter.finish()
27	}
28}
29/// See [`GetDirectThreadOutput`](crate::output::GetDirectThreadOutput)
30pub mod get_direct_thread_output {
31	/// A builder for [`GetDirectThreadOutput`](crate::output::GetDirectThreadOutput)
32	#[non_exhaustive]
33	#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
34	pub struct Builder {
35		pub(crate) thread_id: std::option::Option<std::string::String>,
36		pub(crate) identity: std::option::Option<crate::model::IdentityHandle>,
37	}
38	impl Builder {
39		/// A universally unique identifier.
40		pub fn thread_id(mut self, input: impl Into<std::string::String>) -> Self {
41			self.thread_id = Some(input.into());
42			self
43		}
44		/// A universally unique identifier.
45		pub fn set_thread_id(mut self, input: std::option::Option<std::string::String>) -> Self {
46			self.thread_id = input;
47			self
48		}
49		/// An identity handle.
50		pub fn identity(mut self, input: crate::model::IdentityHandle) -> Self {
51			self.identity = Some(input);
52			self
53		}
54		/// An identity handle.
55		pub fn set_identity(
56			mut self,
57			input: std::option::Option<crate::model::IdentityHandle>,
58		) -> Self {
59			self.identity = input;
60			self
61		}
62		/// Consumes the builder and constructs a [`GetDirectThreadOutput`](crate::output::GetDirectThreadOutput)
63		pub fn build(self) -> crate::output::GetDirectThreadOutput {
64			crate::output::GetDirectThreadOutput {
65				thread_id: self.thread_id,
66				identity: self.identity,
67			}
68		}
69	}
70}
71impl GetDirectThreadOutput {
72	/// Creates a new builder-style object to manufacture [`GetDirectThreadOutput`](crate::output::GetDirectThreadOutput)
73	pub fn builder() -> crate::output::get_direct_thread_output::Builder {
74		crate::output::get_direct_thread_output::Builder::default()
75	}
76}
77
78#[allow(missing_docs)] // documentation missing in model
79#[non_exhaustive]
80#[derive(std::clone::Clone, std::cmp::PartialEq)]
81pub struct SendChatMessageOutput {
82	/// A universally unique identifier.
83	pub chat_message_id: std::option::Option<std::string::String>,
84}
85impl SendChatMessageOutput {
86	/// A universally unique identifier.
87	pub fn chat_message_id(&self) -> std::option::Option<&str> {
88		self.chat_message_id.as_deref()
89	}
90}
91impl std::fmt::Debug for SendChatMessageOutput {
92	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
93		let mut formatter = f.debug_struct("SendChatMessageOutput");
94		formatter.field("chat_message_id", &self.chat_message_id);
95		formatter.finish()
96	}
97}
98/// See [`SendChatMessageOutput`](crate::output::SendChatMessageOutput)
99pub mod send_chat_message_output {
100	/// A builder for [`SendChatMessageOutput`](crate::output::SendChatMessageOutput)
101	#[non_exhaustive]
102	#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
103	pub struct Builder {
104		pub(crate) chat_message_id: std::option::Option<std::string::String>,
105	}
106	impl Builder {
107		/// A universally unique identifier.
108		pub fn chat_message_id(mut self, input: impl Into<std::string::String>) -> Self {
109			self.chat_message_id = Some(input.into());
110			self
111		}
112		/// A universally unique identifier.
113		pub fn set_chat_message_id(
114			mut self,
115			input: std::option::Option<std::string::String>,
116		) -> Self {
117			self.chat_message_id = input;
118			self
119		}
120		/// Consumes the builder and constructs a [`SendChatMessageOutput`](crate::output::SendChatMessageOutput)
121		pub fn build(self) -> crate::output::SendChatMessageOutput {
122			crate::output::SendChatMessageOutput {
123				chat_message_id: self.chat_message_id,
124			}
125		}
126	}
127}
128impl SendChatMessageOutput {
129	/// Creates a new builder-style object to manufacture [`SendChatMessageOutput`](crate::output::SendChatMessageOutput)
130	pub fn builder() -> crate::output::send_chat_message_output::Builder {
131		crate::output::send_chat_message_output::Builder::default()
132	}
133}
134
135#[allow(missing_docs)] // documentation missing in model
136#[non_exhaustive]
137#[derive(std::clone::Clone, std::cmp::PartialEq)]
138pub struct SetTypingStatusOutput {}
139impl std::fmt::Debug for SetTypingStatusOutput {
140	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
141		let mut formatter = f.debug_struct("SetTypingStatusOutput");
142		formatter.finish()
143	}
144}
145/// See [`SetTypingStatusOutput`](crate::output::SetTypingStatusOutput)
146pub mod set_typing_status_output {
147	/// A builder for [`SetTypingStatusOutput`](crate::output::SetTypingStatusOutput)
148	#[non_exhaustive]
149	#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
150	pub struct Builder {}
151	impl Builder {
152		/// Consumes the builder and constructs a [`SetTypingStatusOutput`](crate::output::SetTypingStatusOutput)
153		pub fn build(self) -> crate::output::SetTypingStatusOutput {
154			crate::output::SetTypingStatusOutput {}
155		}
156	}
157}
158impl SetTypingStatusOutput {
159	/// Creates a new builder-style object to manufacture [`SetTypingStatusOutput`](crate::output::SetTypingStatusOutput)
160	pub fn builder() -> crate::output::set_typing_status_output::Builder {
161		crate::output::set_typing_status_output::Builder::default()
162	}
163}
164
165#[allow(missing_docs)] // documentation missing in model
166#[non_exhaustive]
167#[derive(std::clone::Clone, std::cmp::PartialEq)]
168pub struct SetThreadReadOutput {}
169impl std::fmt::Debug for SetThreadReadOutput {
170	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
171		let mut formatter = f.debug_struct("SetThreadReadOutput");
172		formatter.finish()
173	}
174}
175/// See [`SetThreadReadOutput`](crate::output::SetThreadReadOutput)
176pub mod set_thread_read_output {
177	/// A builder for [`SetThreadReadOutput`](crate::output::SetThreadReadOutput)
178	#[non_exhaustive]
179	#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
180	pub struct Builder {}
181	impl Builder {
182		/// Consumes the builder and constructs a [`SetThreadReadOutput`](crate::output::SetThreadReadOutput)
183		pub fn build(self) -> crate::output::SetThreadReadOutput {
184			crate::output::SetThreadReadOutput {}
185		}
186	}
187}
188impl SetThreadReadOutput {
189	/// Creates a new builder-style object to manufacture [`SetThreadReadOutput`](crate::output::SetThreadReadOutput)
190	pub fn builder() -> crate::output::set_thread_read_output::Builder {
191		crate::output::set_thread_read_output::Builder::default()
192	}
193}
194
195#[allow(missing_docs)] // documentation missing in model
196#[non_exhaustive]
197#[derive(std::clone::Clone, std::cmp::PartialEq)]
198pub struct GetThreadHistoryOutput {
199	/// Ordered old to new. If querying `rivet.api.chat.common#before_and_after`, this will be `count * 2` long.
200	pub chat_messages: std::option::Option<std::vec::Vec<crate::model::ChatMessage>>,
201}
202impl GetThreadHistoryOutput {
203	/// Ordered old to new. If querying `rivet.api.chat.common#before_and_after`, this will be `count * 2` long.
204	pub fn chat_messages(&self) -> std::option::Option<&[crate::model::ChatMessage]> {
205		self.chat_messages.as_deref()
206	}
207}
208impl std::fmt::Debug for GetThreadHistoryOutput {
209	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
210		let mut formatter = f.debug_struct("GetThreadHistoryOutput");
211		formatter.field("chat_messages", &self.chat_messages);
212		formatter.finish()
213	}
214}
215/// See [`GetThreadHistoryOutput`](crate::output::GetThreadHistoryOutput)
216pub mod get_thread_history_output {
217	/// A builder for [`GetThreadHistoryOutput`](crate::output::GetThreadHistoryOutput)
218	#[non_exhaustive]
219	#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
220	pub struct Builder {
221		pub(crate) chat_messages: std::option::Option<std::vec::Vec<crate::model::ChatMessage>>,
222	}
223	impl Builder {
224		/// Appends an item to `chat_messages`.
225		///
226		/// To override the contents of this collection use [`set_chat_messages`](Self::set_chat_messages).
227		///
228		/// Ordered old to new. If querying `rivet.api.chat.common#before_and_after`, this will be `count * 2` long.
229		pub fn chat_messages(mut self, input: crate::model::ChatMessage) -> Self {
230			let mut v = self.chat_messages.unwrap_or_default();
231			v.push(input);
232			self.chat_messages = Some(v);
233			self
234		}
235		/// Ordered old to new. If querying `rivet.api.chat.common#before_and_after`, this will be `count * 2` long.
236		pub fn set_chat_messages(
237			mut self,
238			input: std::option::Option<std::vec::Vec<crate::model::ChatMessage>>,
239		) -> Self {
240			self.chat_messages = input;
241			self
242		}
243		/// Consumes the builder and constructs a [`GetThreadHistoryOutput`](crate::output::GetThreadHistoryOutput)
244		pub fn build(self) -> crate::output::GetThreadHistoryOutput {
245			crate::output::GetThreadHistoryOutput {
246				chat_messages: self.chat_messages,
247			}
248		}
249	}
250}
251impl GetThreadHistoryOutput {
252	/// Creates a new builder-style object to manufacture [`GetThreadHistoryOutput`](crate::output::GetThreadHistoryOutput)
253	pub fn builder() -> crate::output::get_thread_history_output::Builder {
254		crate::output::get_thread_history_output::Builder::default()
255	}
256}
257
258#[allow(missing_docs)] // documentation missing in model
259#[non_exhaustive]
260#[derive(std::clone::Clone, std::cmp::PartialEq)]
261pub struct WatchThreadOutput {
262	/// All messages new messages posted to this thread. Ordered old to new.
263	pub chat_messages: std::option::Option<std::vec::Vec<crate::model::ChatMessage>>,
264	/// All identities that are currently typing in this thread.
265	pub typing_statuses: std::option::Option<std::vec::Vec<crate::model::ChatIdentityTypingStatus>>,
266	/// Provided by watchable endpoints used in blocking loops.
267	pub watch: std::option::Option<crate::model::WatchResponse>,
268}
269impl WatchThreadOutput {
270	/// All messages new messages posted to this thread. Ordered old to new.
271	pub fn chat_messages(&self) -> std::option::Option<&[crate::model::ChatMessage]> {
272		self.chat_messages.as_deref()
273	}
274	/// All identities that are currently typing in this thread.
275	pub fn typing_statuses(
276		&self,
277	) -> std::option::Option<&[crate::model::ChatIdentityTypingStatus]> {
278		self.typing_statuses.as_deref()
279	}
280	/// Provided by watchable endpoints used in blocking loops.
281	pub fn watch(&self) -> std::option::Option<&crate::model::WatchResponse> {
282		self.watch.as_ref()
283	}
284}
285impl std::fmt::Debug for WatchThreadOutput {
286	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
287		let mut formatter = f.debug_struct("WatchThreadOutput");
288		formatter.field("chat_messages", &self.chat_messages);
289		formatter.field("typing_statuses", &self.typing_statuses);
290		formatter.field("watch", &self.watch);
291		formatter.finish()
292	}
293}
294/// See [`WatchThreadOutput`](crate::output::WatchThreadOutput)
295pub mod watch_thread_output {
296	/// A builder for [`WatchThreadOutput`](crate::output::WatchThreadOutput)
297	#[non_exhaustive]
298	#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
299	pub struct Builder {
300		pub(crate) chat_messages: std::option::Option<std::vec::Vec<crate::model::ChatMessage>>,
301		pub(crate) typing_statuses:
302			std::option::Option<std::vec::Vec<crate::model::ChatIdentityTypingStatus>>,
303		pub(crate) watch: std::option::Option<crate::model::WatchResponse>,
304	}
305	impl Builder {
306		/// Appends an item to `chat_messages`.
307		///
308		/// To override the contents of this collection use [`set_chat_messages`](Self::set_chat_messages).
309		///
310		/// All messages new messages posted to this thread. Ordered old to new.
311		pub fn chat_messages(mut self, input: crate::model::ChatMessage) -> Self {
312			let mut v = self.chat_messages.unwrap_or_default();
313			v.push(input);
314			self.chat_messages = Some(v);
315			self
316		}
317		/// All messages new messages posted to this thread. Ordered old to new.
318		pub fn set_chat_messages(
319			mut self,
320			input: std::option::Option<std::vec::Vec<crate::model::ChatMessage>>,
321		) -> Self {
322			self.chat_messages = input;
323			self
324		}
325		/// Appends an item to `typing_statuses`.
326		///
327		/// To override the contents of this collection use [`set_typing_statuses`](Self::set_typing_statuses).
328		///
329		/// All identities that are currently typing in this thread.
330		pub fn typing_statuses(mut self, input: crate::model::ChatIdentityTypingStatus) -> Self {
331			let mut v = self.typing_statuses.unwrap_or_default();
332			v.push(input);
333			self.typing_statuses = Some(v);
334			self
335		}
336		/// All identities that are currently typing in this thread.
337		pub fn set_typing_statuses(
338			mut self,
339			input: std::option::Option<std::vec::Vec<crate::model::ChatIdentityTypingStatus>>,
340		) -> Self {
341			self.typing_statuses = input;
342			self
343		}
344		/// Provided by watchable endpoints used in blocking loops.
345		pub fn watch(mut self, input: crate::model::WatchResponse) -> Self {
346			self.watch = Some(input);
347			self
348		}
349		/// Provided by watchable endpoints used in blocking loops.
350		pub fn set_watch(
351			mut self,
352			input: std::option::Option<crate::model::WatchResponse>,
353		) -> Self {
354			self.watch = input;
355			self
356		}
357		/// Consumes the builder and constructs a [`WatchThreadOutput`](crate::output::WatchThreadOutput)
358		pub fn build(self) -> crate::output::WatchThreadOutput {
359			crate::output::WatchThreadOutput {
360				chat_messages: self.chat_messages,
361				typing_statuses: self.typing_statuses,
362				watch: self.watch,
363			}
364		}
365	}
366}
367impl WatchThreadOutput {
368	/// Creates a new builder-style object to manufacture [`WatchThreadOutput`](crate::output::WatchThreadOutput)
369	pub fn builder() -> crate::output::watch_thread_output::Builder {
370		crate::output::watch_thread_output::Builder::default()
371	}
372}
373
374#[allow(missing_docs)] // documentation missing in model
375#[non_exhaustive]
376#[derive(std::clone::Clone, std::cmp::PartialEq)]
377pub struct GetThreadTopicOutput {
378	/// Represents a topic of the given chat thread without the associated handles for the topic.
379	pub topic: std::option::Option<crate::model::ChatSimpleTopic>,
380}
381impl GetThreadTopicOutput {
382	/// Represents a topic of the given chat thread without the associated handles for the topic.
383	pub fn topic(&self) -> std::option::Option<&crate::model::ChatSimpleTopic> {
384		self.topic.as_ref()
385	}
386}
387impl std::fmt::Debug for GetThreadTopicOutput {
388	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
389		let mut formatter = f.debug_struct("GetThreadTopicOutput");
390		formatter.field("topic", &self.topic);
391		formatter.finish()
392	}
393}
394/// See [`GetThreadTopicOutput`](crate::output::GetThreadTopicOutput)
395pub mod get_thread_topic_output {
396	/// A builder for [`GetThreadTopicOutput`](crate::output::GetThreadTopicOutput)
397	#[non_exhaustive]
398	#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
399	pub struct Builder {
400		pub(crate) topic: std::option::Option<crate::model::ChatSimpleTopic>,
401	}
402	impl Builder {
403		/// Represents a topic of the given chat thread without the associated handles for the topic.
404		pub fn topic(mut self, input: crate::model::ChatSimpleTopic) -> Self {
405			self.topic = Some(input);
406			self
407		}
408		/// Represents a topic of the given chat thread without the associated handles for the topic.
409		pub fn set_topic(
410			mut self,
411			input: std::option::Option<crate::model::ChatSimpleTopic>,
412		) -> Self {
413			self.topic = input;
414			self
415		}
416		/// Consumes the builder and constructs a [`GetThreadTopicOutput`](crate::output::GetThreadTopicOutput)
417		pub fn build(self) -> crate::output::GetThreadTopicOutput {
418			crate::output::GetThreadTopicOutput { topic: self.topic }
419		}
420	}
421}
422impl GetThreadTopicOutput {
423	/// Creates a new builder-style object to manufacture [`GetThreadTopicOutput`](crate::output::GetThreadTopicOutput)
424	pub fn builder() -> crate::output::get_thread_topic_output::Builder {
425		crate::output::get_thread_topic_output::Builder::default()
426	}
427}