aws_sdk_qbusiness/operation/chat_sync/
_chat_sync_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, ::std::fmt::Debug)]
5pub struct ChatSyncOutput {
6    /// <p>The identifier of the Amazon Q Business conversation.</p>
7    pub conversation_id: ::std::option::Option<::std::string::String>,
8    /// <p>An AI-generated message in a conversation.</p>
9    pub system_message: ::std::option::Option<::std::string::String>,
10    /// <p>The identifier of an Amazon Q Business AI generated message within the conversation.</p>
11    pub system_message_id: ::std::option::Option<::std::string::String>,
12    /// <p>The identifier of an Amazon Q Business end user text input message within the conversation.</p>
13    pub user_message_id: ::std::option::Option<::std::string::String>,
14    /// <p>A request from Amazon Q Business to the end user for information Amazon Q Business needs to successfully complete a requested plugin action.</p>
15    pub action_review: ::std::option::Option<crate::types::ActionReview>,
16    /// <p>An authentication verification event activated by an end user request to use a custom plugin.</p>
17    pub auth_challenge_request: ::std::option::Option<crate::types::AuthChallengeRequest>,
18    /// <p>The source documents used to generate the conversation response.</p>
19    pub source_attributions: ::std::option::Option<::std::vec::Vec<::std::option::Option<crate::types::SourceAttribution>>>,
20    /// <p>A list of files which failed to upload during chat.</p>
21    pub failed_attachments: ::std::option::Option<::std::vec::Vec<crate::types::AttachmentOutput>>,
22    _request_id: Option<String>,
23}
24impl ChatSyncOutput {
25    /// <p>The identifier of the Amazon Q Business conversation.</p>
26    pub fn conversation_id(&self) -> ::std::option::Option<&str> {
27        self.conversation_id.as_deref()
28    }
29    /// <p>An AI-generated message in a conversation.</p>
30    pub fn system_message(&self) -> ::std::option::Option<&str> {
31        self.system_message.as_deref()
32    }
33    /// <p>The identifier of an Amazon Q Business AI generated message within the conversation.</p>
34    pub fn system_message_id(&self) -> ::std::option::Option<&str> {
35        self.system_message_id.as_deref()
36    }
37    /// <p>The identifier of an Amazon Q Business end user text input message within the conversation.</p>
38    pub fn user_message_id(&self) -> ::std::option::Option<&str> {
39        self.user_message_id.as_deref()
40    }
41    /// <p>A request from Amazon Q Business to the end user for information Amazon Q Business needs to successfully complete a requested plugin action.</p>
42    pub fn action_review(&self) -> ::std::option::Option<&crate::types::ActionReview> {
43        self.action_review.as_ref()
44    }
45    /// <p>An authentication verification event activated by an end user request to use a custom plugin.</p>
46    pub fn auth_challenge_request(&self) -> ::std::option::Option<&crate::types::AuthChallengeRequest> {
47        self.auth_challenge_request.as_ref()
48    }
49    /// <p>The source documents used to generate the conversation response.</p>
50    ///
51    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.source_attributions.is_none()`.
52    pub fn source_attributions(&self) -> &[::std::option::Option<crate::types::SourceAttribution>] {
53        self.source_attributions.as_deref().unwrap_or_default()
54    }
55    /// <p>A list of files which failed to upload during chat.</p>
56    ///
57    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.failed_attachments.is_none()`.
58    pub fn failed_attachments(&self) -> &[crate::types::AttachmentOutput] {
59        self.failed_attachments.as_deref().unwrap_or_default()
60    }
61}
62impl ::aws_types::request_id::RequestId for ChatSyncOutput {
63    fn request_id(&self) -> Option<&str> {
64        self._request_id.as_deref()
65    }
66}
67impl ChatSyncOutput {
68    /// Creates a new builder-style object to manufacture [`ChatSyncOutput`](crate::operation::chat_sync::ChatSyncOutput).
69    pub fn builder() -> crate::operation::chat_sync::builders::ChatSyncOutputBuilder {
70        crate::operation::chat_sync::builders::ChatSyncOutputBuilder::default()
71    }
72}
73
74/// A builder for [`ChatSyncOutput`](crate::operation::chat_sync::ChatSyncOutput).
75#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
76#[non_exhaustive]
77pub struct ChatSyncOutputBuilder {
78    pub(crate) conversation_id: ::std::option::Option<::std::string::String>,
79    pub(crate) system_message: ::std::option::Option<::std::string::String>,
80    pub(crate) system_message_id: ::std::option::Option<::std::string::String>,
81    pub(crate) user_message_id: ::std::option::Option<::std::string::String>,
82    pub(crate) action_review: ::std::option::Option<crate::types::ActionReview>,
83    pub(crate) auth_challenge_request: ::std::option::Option<crate::types::AuthChallengeRequest>,
84    pub(crate) source_attributions: ::std::option::Option<::std::vec::Vec<::std::option::Option<crate::types::SourceAttribution>>>,
85    pub(crate) failed_attachments: ::std::option::Option<::std::vec::Vec<crate::types::AttachmentOutput>>,
86    _request_id: Option<String>,
87}
88impl ChatSyncOutputBuilder {
89    /// <p>The identifier of the Amazon Q Business conversation.</p>
90    pub fn conversation_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
91        self.conversation_id = ::std::option::Option::Some(input.into());
92        self
93    }
94    /// <p>The identifier of the Amazon Q Business conversation.</p>
95    pub fn set_conversation_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
96        self.conversation_id = input;
97        self
98    }
99    /// <p>The identifier of the Amazon Q Business conversation.</p>
100    pub fn get_conversation_id(&self) -> &::std::option::Option<::std::string::String> {
101        &self.conversation_id
102    }
103    /// <p>An AI-generated message in a conversation.</p>
104    pub fn system_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
105        self.system_message = ::std::option::Option::Some(input.into());
106        self
107    }
108    /// <p>An AI-generated message in a conversation.</p>
109    pub fn set_system_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
110        self.system_message = input;
111        self
112    }
113    /// <p>An AI-generated message in a conversation.</p>
114    pub fn get_system_message(&self) -> &::std::option::Option<::std::string::String> {
115        &self.system_message
116    }
117    /// <p>The identifier of an Amazon Q Business AI generated message within the conversation.</p>
118    pub fn system_message_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
119        self.system_message_id = ::std::option::Option::Some(input.into());
120        self
121    }
122    /// <p>The identifier of an Amazon Q Business AI generated message within the conversation.</p>
123    pub fn set_system_message_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
124        self.system_message_id = input;
125        self
126    }
127    /// <p>The identifier of an Amazon Q Business AI generated message within the conversation.</p>
128    pub fn get_system_message_id(&self) -> &::std::option::Option<::std::string::String> {
129        &self.system_message_id
130    }
131    /// <p>The identifier of an Amazon Q Business end user text input message within the conversation.</p>
132    pub fn user_message_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
133        self.user_message_id = ::std::option::Option::Some(input.into());
134        self
135    }
136    /// <p>The identifier of an Amazon Q Business end user text input message within the conversation.</p>
137    pub fn set_user_message_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
138        self.user_message_id = input;
139        self
140    }
141    /// <p>The identifier of an Amazon Q Business end user text input message within the conversation.</p>
142    pub fn get_user_message_id(&self) -> &::std::option::Option<::std::string::String> {
143        &self.user_message_id
144    }
145    /// <p>A request from Amazon Q Business to the end user for information Amazon Q Business needs to successfully complete a requested plugin action.</p>
146    pub fn action_review(mut self, input: crate::types::ActionReview) -> Self {
147        self.action_review = ::std::option::Option::Some(input);
148        self
149    }
150    /// <p>A request from Amazon Q Business to the end user for information Amazon Q Business needs to successfully complete a requested plugin action.</p>
151    pub fn set_action_review(mut self, input: ::std::option::Option<crate::types::ActionReview>) -> Self {
152        self.action_review = input;
153        self
154    }
155    /// <p>A request from Amazon Q Business to the end user for information Amazon Q Business needs to successfully complete a requested plugin action.</p>
156    pub fn get_action_review(&self) -> &::std::option::Option<crate::types::ActionReview> {
157        &self.action_review
158    }
159    /// <p>An authentication verification event activated by an end user request to use a custom plugin.</p>
160    pub fn auth_challenge_request(mut self, input: crate::types::AuthChallengeRequest) -> Self {
161        self.auth_challenge_request = ::std::option::Option::Some(input);
162        self
163    }
164    /// <p>An authentication verification event activated by an end user request to use a custom plugin.</p>
165    pub fn set_auth_challenge_request(mut self, input: ::std::option::Option<crate::types::AuthChallengeRequest>) -> Self {
166        self.auth_challenge_request = input;
167        self
168    }
169    /// <p>An authentication verification event activated by an end user request to use a custom plugin.</p>
170    pub fn get_auth_challenge_request(&self) -> &::std::option::Option<crate::types::AuthChallengeRequest> {
171        &self.auth_challenge_request
172    }
173    /// Appends an item to `source_attributions`.
174    ///
175    /// To override the contents of this collection use [`set_source_attributions`](Self::set_source_attributions).
176    ///
177    /// <p>The source documents used to generate the conversation response.</p>
178    pub fn source_attributions(mut self, input: ::std::option::Option<crate::types::SourceAttribution>) -> Self {
179        let mut v = self.source_attributions.unwrap_or_default();
180        v.push(input);
181        self.source_attributions = ::std::option::Option::Some(v);
182        self
183    }
184    /// <p>The source documents used to generate the conversation response.</p>
185    pub fn set_source_attributions(
186        mut self,
187        input: ::std::option::Option<::std::vec::Vec<::std::option::Option<crate::types::SourceAttribution>>>,
188    ) -> Self {
189        self.source_attributions = input;
190        self
191    }
192    /// <p>The source documents used to generate the conversation response.</p>
193    pub fn get_source_attributions(&self) -> &::std::option::Option<::std::vec::Vec<::std::option::Option<crate::types::SourceAttribution>>> {
194        &self.source_attributions
195    }
196    /// Appends an item to `failed_attachments`.
197    ///
198    /// To override the contents of this collection use [`set_failed_attachments`](Self::set_failed_attachments).
199    ///
200    /// <p>A list of files which failed to upload during chat.</p>
201    pub fn failed_attachments(mut self, input: crate::types::AttachmentOutput) -> Self {
202        let mut v = self.failed_attachments.unwrap_or_default();
203        v.push(input);
204        self.failed_attachments = ::std::option::Option::Some(v);
205        self
206    }
207    /// <p>A list of files which failed to upload during chat.</p>
208    pub fn set_failed_attachments(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AttachmentOutput>>) -> Self {
209        self.failed_attachments = input;
210        self
211    }
212    /// <p>A list of files which failed to upload during chat.</p>
213    pub fn get_failed_attachments(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AttachmentOutput>> {
214        &self.failed_attachments
215    }
216    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
217        self._request_id = Some(request_id.into());
218        self
219    }
220
221    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
222        self._request_id = request_id;
223        self
224    }
225    /// Consumes the builder and constructs a [`ChatSyncOutput`](crate::operation::chat_sync::ChatSyncOutput).
226    pub fn build(self) -> crate::operation::chat_sync::ChatSyncOutput {
227        crate::operation::chat_sync::ChatSyncOutput {
228            conversation_id: self.conversation_id,
229            system_message: self.system_message,
230            system_message_id: self.system_message_id,
231            user_message_id: self.user_message_id,
232            action_review: self.action_review,
233            auth_challenge_request: self.auth_challenge_request,
234            source_attributions: self.source_attributions,
235            failed_attachments: self.failed_attachments,
236            _request_id: self._request_id,
237        }
238    }
239}