aws_sdk_qbusiness/operation/chat/
_chat_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::fmt::Debug)]
5pub struct ChatInput {
6 pub application_id: ::std::option::Option<::std::string::String>,
8 pub user_id: ::std::option::Option<::std::string::String>,
10 pub user_groups: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
12 pub conversation_id: ::std::option::Option<::std::string::String>,
14 pub parent_message_id: ::std::option::Option<::std::string::String>,
16 pub client_token: ::std::option::Option<::std::string::String>,
18 pub input_stream: ::aws_smithy_http::event_stream::EventStreamSender<crate::types::ChatInputStream, crate::types::error::ChatInputStreamError>,
20}
21impl ChatInput {
22 pub fn application_id(&self) -> ::std::option::Option<&str> {
24 self.application_id.as_deref()
25 }
26 pub fn user_id(&self) -> ::std::option::Option<&str> {
28 self.user_id.as_deref()
29 }
30 pub fn user_groups(&self) -> &[::std::string::String] {
34 self.user_groups.as_deref().unwrap_or_default()
35 }
36 pub fn conversation_id(&self) -> ::std::option::Option<&str> {
38 self.conversation_id.as_deref()
39 }
40 pub fn parent_message_id(&self) -> ::std::option::Option<&str> {
42 self.parent_message_id.as_deref()
43 }
44 pub fn client_token(&self) -> ::std::option::Option<&str> {
46 self.client_token.as_deref()
47 }
48 pub fn input_stream(
50 &self,
51 ) -> &::aws_smithy_http::event_stream::EventStreamSender<crate::types::ChatInputStream, crate::types::error::ChatInputStreamError> {
52 &self.input_stream
53 }
54}
55impl ChatInput {
56 pub fn builder() -> crate::operation::chat::builders::ChatInputBuilder {
58 crate::operation::chat::builders::ChatInputBuilder::default()
59 }
60}
61
62#[derive(::std::default::Default, ::std::fmt::Debug)]
64#[non_exhaustive]
65pub struct ChatInputBuilder {
66 pub(crate) application_id: ::std::option::Option<::std::string::String>,
67 pub(crate) user_id: ::std::option::Option<::std::string::String>,
68 pub(crate) user_groups: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
69 pub(crate) conversation_id: ::std::option::Option<::std::string::String>,
70 pub(crate) parent_message_id: ::std::option::Option<::std::string::String>,
71 pub(crate) client_token: ::std::option::Option<::std::string::String>,
72 pub(crate) input_stream: ::std::option::Option<
73 ::aws_smithy_http::event_stream::EventStreamSender<crate::types::ChatInputStream, crate::types::error::ChatInputStreamError>,
74 >,
75}
76impl ChatInputBuilder {
77 pub fn application_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
80 self.application_id = ::std::option::Option::Some(input.into());
81 self
82 }
83 pub fn set_application_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
85 self.application_id = input;
86 self
87 }
88 pub fn get_application_id(&self) -> &::std::option::Option<::std::string::String> {
90 &self.application_id
91 }
92 pub fn user_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
94 self.user_id = ::std::option::Option::Some(input.into());
95 self
96 }
97 pub fn set_user_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
99 self.user_id = input;
100 self
101 }
102 pub fn get_user_id(&self) -> &::std::option::Option<::std::string::String> {
104 &self.user_id
105 }
106 pub fn user_groups(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
112 let mut v = self.user_groups.unwrap_or_default();
113 v.push(input.into());
114 self.user_groups = ::std::option::Option::Some(v);
115 self
116 }
117 pub fn set_user_groups(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
119 self.user_groups = input;
120 self
121 }
122 pub fn get_user_groups(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
124 &self.user_groups
125 }
126 pub fn conversation_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
128 self.conversation_id = ::std::option::Option::Some(input.into());
129 self
130 }
131 pub fn set_conversation_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
133 self.conversation_id = input;
134 self
135 }
136 pub fn get_conversation_id(&self) -> &::std::option::Option<::std::string::String> {
138 &self.conversation_id
139 }
140 pub fn parent_message_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
142 self.parent_message_id = ::std::option::Option::Some(input.into());
143 self
144 }
145 pub fn set_parent_message_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
147 self.parent_message_id = input;
148 self
149 }
150 pub fn get_parent_message_id(&self) -> &::std::option::Option<::std::string::String> {
152 &self.parent_message_id
153 }
154 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
156 self.client_token = ::std::option::Option::Some(input.into());
157 self
158 }
159 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
161 self.client_token = input;
162 self
163 }
164 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
166 &self.client_token
167 }
168 pub fn input_stream(
170 mut self,
171 input: ::aws_smithy_http::event_stream::EventStreamSender<crate::types::ChatInputStream, crate::types::error::ChatInputStreamError>,
172 ) -> Self {
173 self.input_stream = ::std::option::Option::Some(input);
174 self
175 }
176 pub fn set_input_stream(
178 mut self,
179 input: ::std::option::Option<
180 ::aws_smithy_http::event_stream::EventStreamSender<crate::types::ChatInputStream, crate::types::error::ChatInputStreamError>,
181 >,
182 ) -> Self {
183 self.input_stream = input;
184 self
185 }
186 pub fn get_input_stream(
188 &self,
189 ) -> &::std::option::Option<
190 ::aws_smithy_http::event_stream::EventStreamSender<crate::types::ChatInputStream, crate::types::error::ChatInputStreamError>,
191 > {
192 &self.input_stream
193 }
194 pub fn build(self) -> ::std::result::Result<crate::operation::chat::ChatInput, ::aws_smithy_types::error::operation::BuildError> {
198 ::std::result::Result::Ok(crate::operation::chat::ChatInput {
199 application_id: self.application_id,
200 user_id: self.user_id,
201 user_groups: self.user_groups,
202 conversation_id: self.conversation_id,
203 parent_message_id: self.parent_message_id,
204 client_token: self.client_token,
205 input_stream: self.input_stream.ok_or_else(|| {
206 ::aws_smithy_types::error::operation::BuildError::missing_field(
207 "input_stream",
208 "input_stream was not specified but it is required when building ChatInput",
209 )
210 })?,
211 })
212 }
213}