aws_sdk_qbusiness/operation/chat_sync/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::chat_sync::_chat_sync_output::ChatSyncOutputBuilder;
3
4pub use crate::operation::chat_sync::_chat_sync_input::ChatSyncInputBuilder;
5
6impl crate::operation::chat_sync::builders::ChatSyncInputBuilder {
7 /// Sends a request with this input using the given client.
8 pub async fn send_with(
9 self,
10 client: &crate::Client,
11 ) -> ::std::result::Result<
12 crate::operation::chat_sync::ChatSyncOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::chat_sync::ChatSyncError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.chat_sync();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `ChatSync`.
24///
25/// <p>Starts or continues a non-streaming Amazon Q Business conversation.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct ChatSyncFluentBuilder {
28 handle: ::std::sync::Arc<crate::client::Handle>,
29 inner: crate::operation::chat_sync::builders::ChatSyncInputBuilder,
30 config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl crate::client::customize::internal::CustomizableSend<crate::operation::chat_sync::ChatSyncOutput, crate::operation::chat_sync::ChatSyncError>
33 for ChatSyncFluentBuilder
34{
35 fn send(
36 self,
37 config_override: crate::config::Builder,
38 ) -> crate::client::customize::internal::BoxFuture<
39 crate::client::customize::internal::SendResult<crate::operation::chat_sync::ChatSyncOutput, crate::operation::chat_sync::ChatSyncError>,
40 > {
41 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
42 }
43}
44impl ChatSyncFluentBuilder {
45 /// Creates a new `ChatSyncFluentBuilder`.
46 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
47 Self {
48 handle,
49 inner: ::std::default::Default::default(),
50 config_override: ::std::option::Option::None,
51 }
52 }
53 /// Access the ChatSync as a reference.
54 pub fn as_input(&self) -> &crate::operation::chat_sync::builders::ChatSyncInputBuilder {
55 &self.inner
56 }
57 /// Sends the request and returns the response.
58 ///
59 /// If an error occurs, an `SdkError` will be returned with additional details that
60 /// can be matched against.
61 ///
62 /// By default, any retryable failures will be retried twice. Retry behavior
63 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
64 /// set when configuring the client.
65 pub async fn send(
66 self,
67 ) -> ::std::result::Result<
68 crate::operation::chat_sync::ChatSyncOutput,
69 ::aws_smithy_runtime_api::client::result::SdkError<
70 crate::operation::chat_sync::ChatSyncError,
71 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
72 >,
73 > {
74 let input = self
75 .inner
76 .build()
77 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
78 let runtime_plugins = crate::operation::chat_sync::ChatSync::operation_runtime_plugins(
79 self.handle.runtime_plugins.clone(),
80 &self.handle.conf,
81 self.config_override,
82 );
83 crate::operation::chat_sync::ChatSync::orchestrate(&runtime_plugins, input).await
84 }
85
86 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
87 pub fn customize(
88 self,
89 ) -> crate::client::customize::CustomizableOperation<crate::operation::chat_sync::ChatSyncOutput, crate::operation::chat_sync::ChatSyncError, Self>
90 {
91 crate::client::customize::CustomizableOperation::new(self)
92 }
93 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
94 self.set_config_override(::std::option::Option::Some(config_override.into()));
95 self
96 }
97
98 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
99 self.config_override = config_override;
100 self
101 }
102 /// <p>The identifier of the Amazon Q Business application linked to the Amazon Q Business conversation.</p>
103 pub fn application_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
104 self.inner = self.inner.application_id(input.into());
105 self
106 }
107 /// <p>The identifier of the Amazon Q Business application linked to the Amazon Q Business conversation.</p>
108 pub fn set_application_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
109 self.inner = self.inner.set_application_id(input);
110 self
111 }
112 /// <p>The identifier of the Amazon Q Business application linked to the Amazon Q Business conversation.</p>
113 pub fn get_application_id(&self) -> &::std::option::Option<::std::string::String> {
114 self.inner.get_application_id()
115 }
116 /// <p>The identifier of the user attached to the chat input.</p>
117 pub fn user_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
118 self.inner = self.inner.user_id(input.into());
119 self
120 }
121 /// <p>The identifier of the user attached to the chat input.</p>
122 pub fn set_user_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
123 self.inner = self.inner.set_user_id(input);
124 self
125 }
126 /// <p>The identifier of the user attached to the chat input.</p>
127 pub fn get_user_id(&self) -> &::std::option::Option<::std::string::String> {
128 self.inner.get_user_id()
129 }
130 ///
131 /// Appends an item to `userGroups`.
132 ///
133 /// To override the contents of this collection use [`set_user_groups`](Self::set_user_groups).
134 ///
135 /// <p>The group names that a user associated with the chat input belongs to.</p>
136 pub fn user_groups(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
137 self.inner = self.inner.user_groups(input.into());
138 self
139 }
140 /// <p>The group names that a user associated with the chat input belongs to.</p>
141 pub fn set_user_groups(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
142 self.inner = self.inner.set_user_groups(input);
143 self
144 }
145 /// <p>The group names that a user associated with the chat input belongs to.</p>
146 pub fn get_user_groups(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
147 self.inner.get_user_groups()
148 }
149 /// <p>A end user message in a conversation.</p>
150 pub fn user_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
151 self.inner = self.inner.user_message(input.into());
152 self
153 }
154 /// <p>A end user message in a conversation.</p>
155 pub fn set_user_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
156 self.inner = self.inner.set_user_message(input);
157 self
158 }
159 /// <p>A end user message in a conversation.</p>
160 pub fn get_user_message(&self) -> &::std::option::Option<::std::string::String> {
161 self.inner.get_user_message()
162 }
163 ///
164 /// Appends an item to `attachments`.
165 ///
166 /// To override the contents of this collection use [`set_attachments`](Self::set_attachments).
167 ///
168 /// <p>A list of files uploaded directly during chat. You can upload a maximum of 5 files of upto 10 MB each.</p>
169 pub fn attachments(mut self, input: crate::types::AttachmentInput) -> Self {
170 self.inner = self.inner.attachments(input);
171 self
172 }
173 /// <p>A list of files uploaded directly during chat. You can upload a maximum of 5 files of upto 10 MB each.</p>
174 pub fn set_attachments(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AttachmentInput>>) -> Self {
175 self.inner = self.inner.set_attachments(input);
176 self
177 }
178 /// <p>A list of files uploaded directly during chat. You can upload a maximum of 5 files of upto 10 MB each.</p>
179 pub fn get_attachments(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AttachmentInput>> {
180 self.inner.get_attachments()
181 }
182 /// <p>A request from an end user to perform an Amazon Q Business plugin action.</p>
183 pub fn action_execution(mut self, input: crate::types::ActionExecution) -> Self {
184 self.inner = self.inner.action_execution(input);
185 self
186 }
187 /// <p>A request from an end user to perform an Amazon Q Business plugin action.</p>
188 pub fn set_action_execution(mut self, input: ::std::option::Option<crate::types::ActionExecution>) -> Self {
189 self.inner = self.inner.set_action_execution(input);
190 self
191 }
192 /// <p>A request from an end user to perform an Amazon Q Business plugin action.</p>
193 pub fn get_action_execution(&self) -> &::std::option::Option<crate::types::ActionExecution> {
194 self.inner.get_action_execution()
195 }
196 /// <p>An authentication verification event response by a third party authentication server to Amazon Q Business.</p>
197 pub fn auth_challenge_response(mut self, input: crate::types::AuthChallengeResponse) -> Self {
198 self.inner = self.inner.auth_challenge_response(input);
199 self
200 }
201 /// <p>An authentication verification event response by a third party authentication server to Amazon Q Business.</p>
202 pub fn set_auth_challenge_response(mut self, input: ::std::option::Option<crate::types::AuthChallengeResponse>) -> Self {
203 self.inner = self.inner.set_auth_challenge_response(input);
204 self
205 }
206 /// <p>An authentication verification event response by a third party authentication server to Amazon Q Business.</p>
207 pub fn get_auth_challenge_response(&self) -> &::std::option::Option<crate::types::AuthChallengeResponse> {
208 self.inner.get_auth_challenge_response()
209 }
210 /// <p>The identifier of the Amazon Q Business conversation.</p>
211 pub fn conversation_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
212 self.inner = self.inner.conversation_id(input.into());
213 self
214 }
215 /// <p>The identifier of the Amazon Q Business conversation.</p>
216 pub fn set_conversation_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
217 self.inner = self.inner.set_conversation_id(input);
218 self
219 }
220 /// <p>The identifier of the Amazon Q Business conversation.</p>
221 pub fn get_conversation_id(&self) -> &::std::option::Option<::std::string::String> {
222 self.inner.get_conversation_id()
223 }
224 /// <p>The identifier of the previous system message in a conversation.</p>
225 pub fn parent_message_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
226 self.inner = self.inner.parent_message_id(input.into());
227 self
228 }
229 /// <p>The identifier of the previous system message in a conversation.</p>
230 pub fn set_parent_message_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
231 self.inner = self.inner.set_parent_message_id(input);
232 self
233 }
234 /// <p>The identifier of the previous system message in a conversation.</p>
235 pub fn get_parent_message_id(&self) -> &::std::option::Option<::std::string::String> {
236 self.inner.get_parent_message_id()
237 }
238 /// <p>Enables filtering of Amazon Q Business web experience responses based on document attributes or metadata fields.</p>
239 pub fn attribute_filter(mut self, input: crate::types::AttributeFilter) -> Self {
240 self.inner = self.inner.attribute_filter(input);
241 self
242 }
243 /// <p>Enables filtering of Amazon Q Business web experience responses based on document attributes or metadata fields.</p>
244 pub fn set_attribute_filter(mut self, input: ::std::option::Option<crate::types::AttributeFilter>) -> Self {
245 self.inner = self.inner.set_attribute_filter(input);
246 self
247 }
248 /// <p>Enables filtering of Amazon Q Business web experience responses based on document attributes or metadata fields.</p>
249 pub fn get_attribute_filter(&self) -> &::std::option::Option<crate::types::AttributeFilter> {
250 self.inner.get_attribute_filter()
251 }
252 /// <p>The <code>chatMode</code> parameter determines the chat modes available to Amazon Q Business users:</p>
253 /// <ul>
254 /// <li>
255 /// <p><code>RETRIEVAL_MODE</code> - If you choose this mode, Amazon Q generates responses solely from the data sources connected and indexed by the application. If an answer is not found in the data sources or there are no data sources available, Amazon Q will respond with a "<i>No Answer Found</i>" message, unless LLM knowledge has been enabled. In that case, Amazon Q will generate a response from the LLM knowledge</p></li>
256 /// <li>
257 /// <p><code>CREATOR_MODE</code> - By selecting this mode, you can choose to generate responses only from the LLM knowledge. You can also attach files and have Amazon Q generate a response based on the data in those files. If the attached files do not contain an answer for the query, Amazon Q will automatically fall back to generating a response from the LLM knowledge.</p></li>
258 /// <li>
259 /// <p><code>PLUGIN_MODE</code> - By selecting this mode, users can choose to use plugins in chat to get their responses.</p></li>
260 /// </ul><note>
261 /// <p>If none of the modes are selected, Amazon Q will only respond using the information from the attached files.</p>
262 /// </note>
263 /// <p>For more information, see <a href="https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/guardrails.html">Admin controls and guardrails</a>, <a href="https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/plugins.html">Plugins</a>, and <a href="https://docs.aws.amazon.com/amazonq/latest/business-use-dg/using-web-experience.html#chat-source-scope">Response sources</a>.</p>
264 pub fn chat_mode(mut self, input: crate::types::ChatMode) -> Self {
265 self.inner = self.inner.chat_mode(input);
266 self
267 }
268 /// <p>The <code>chatMode</code> parameter determines the chat modes available to Amazon Q Business users:</p>
269 /// <ul>
270 /// <li>
271 /// <p><code>RETRIEVAL_MODE</code> - If you choose this mode, Amazon Q generates responses solely from the data sources connected and indexed by the application. If an answer is not found in the data sources or there are no data sources available, Amazon Q will respond with a "<i>No Answer Found</i>" message, unless LLM knowledge has been enabled. In that case, Amazon Q will generate a response from the LLM knowledge</p></li>
272 /// <li>
273 /// <p><code>CREATOR_MODE</code> - By selecting this mode, you can choose to generate responses only from the LLM knowledge. You can also attach files and have Amazon Q generate a response based on the data in those files. If the attached files do not contain an answer for the query, Amazon Q will automatically fall back to generating a response from the LLM knowledge.</p></li>
274 /// <li>
275 /// <p><code>PLUGIN_MODE</code> - By selecting this mode, users can choose to use plugins in chat to get their responses.</p></li>
276 /// </ul><note>
277 /// <p>If none of the modes are selected, Amazon Q will only respond using the information from the attached files.</p>
278 /// </note>
279 /// <p>For more information, see <a href="https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/guardrails.html">Admin controls and guardrails</a>, <a href="https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/plugins.html">Plugins</a>, and <a href="https://docs.aws.amazon.com/amazonq/latest/business-use-dg/using-web-experience.html#chat-source-scope">Response sources</a>.</p>
280 pub fn set_chat_mode(mut self, input: ::std::option::Option<crate::types::ChatMode>) -> Self {
281 self.inner = self.inner.set_chat_mode(input);
282 self
283 }
284 /// <p>The <code>chatMode</code> parameter determines the chat modes available to Amazon Q Business users:</p>
285 /// <ul>
286 /// <li>
287 /// <p><code>RETRIEVAL_MODE</code> - If you choose this mode, Amazon Q generates responses solely from the data sources connected and indexed by the application. If an answer is not found in the data sources or there are no data sources available, Amazon Q will respond with a "<i>No Answer Found</i>" message, unless LLM knowledge has been enabled. In that case, Amazon Q will generate a response from the LLM knowledge</p></li>
288 /// <li>
289 /// <p><code>CREATOR_MODE</code> - By selecting this mode, you can choose to generate responses only from the LLM knowledge. You can also attach files and have Amazon Q generate a response based on the data in those files. If the attached files do not contain an answer for the query, Amazon Q will automatically fall back to generating a response from the LLM knowledge.</p></li>
290 /// <li>
291 /// <p><code>PLUGIN_MODE</code> - By selecting this mode, users can choose to use plugins in chat to get their responses.</p></li>
292 /// </ul><note>
293 /// <p>If none of the modes are selected, Amazon Q will only respond using the information from the attached files.</p>
294 /// </note>
295 /// <p>For more information, see <a href="https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/guardrails.html">Admin controls and guardrails</a>, <a href="https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/plugins.html">Plugins</a>, and <a href="https://docs.aws.amazon.com/amazonq/latest/business-use-dg/using-web-experience.html#chat-source-scope">Response sources</a>.</p>
296 pub fn get_chat_mode(&self) -> &::std::option::Option<crate::types::ChatMode> {
297 self.inner.get_chat_mode()
298 }
299 /// <p>The chat mode configuration for an Amazon Q Business application.</p>
300 pub fn chat_mode_configuration(mut self, input: crate::types::ChatModeConfiguration) -> Self {
301 self.inner = self.inner.chat_mode_configuration(input);
302 self
303 }
304 /// <p>The chat mode configuration for an Amazon Q Business application.</p>
305 pub fn set_chat_mode_configuration(mut self, input: ::std::option::Option<crate::types::ChatModeConfiguration>) -> Self {
306 self.inner = self.inner.set_chat_mode_configuration(input);
307 self
308 }
309 /// <p>The chat mode configuration for an Amazon Q Business application.</p>
310 pub fn get_chat_mode_configuration(&self) -> &::std::option::Option<crate::types::ChatModeConfiguration> {
311 self.inner.get_chat_mode_configuration()
312 }
313 /// <p>A token that you provide to identify a chat request.</p>
314 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
315 self.inner = self.inner.client_token(input.into());
316 self
317 }
318 /// <p>A token that you provide to identify a chat request.</p>
319 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
320 self.inner = self.inner.set_client_token(input);
321 self
322 }
323 /// <p>A token that you provide to identify a chat request.</p>
324 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
325 self.inner.get_client_token()
326 }
327}