1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct ChatSyncOutput {
    /// <p>The identifier of the Amazon Q conversation.</p>
    pub conversation_id: ::std::option::Option<::std::string::String>,
    /// <p>An AI-generated message in a conversation.</p>
    pub system_message: ::std::option::Option<::std::string::String>,
    /// <p>The identifier of an Amazon Q AI generated message within the conversation.</p>
    pub system_message_id: ::std::option::Option<::std::string::String>,
    /// <p>The identifier of an Amazon Q end user text input message within the conversation.</p>
    pub user_message_id: ::std::option::Option<::std::string::String>,
    /// <p>A request from Amazon Q to the end user for information Amazon Q needs to successfully complete a requested plugin action.</p>
    pub action_review: ::std::option::Option<crate::types::ActionReview>,
    /// <p>The source documents used to generate the conversation response.</p>
    pub source_attributions: ::std::option::Option<::std::vec::Vec<::std::option::Option<crate::types::SourceAttribution>>>,
    /// <p>A list of files which failed to upload during chat.</p>
    pub failed_attachments: ::std::option::Option<::std::vec::Vec<crate::types::AttachmentOutput>>,
    _request_id: Option<String>,
}
impl ChatSyncOutput {
    /// <p>The identifier of the Amazon Q conversation.</p>
    pub fn conversation_id(&self) -> ::std::option::Option<&str> {
        self.conversation_id.as_deref()
    }
    /// <p>An AI-generated message in a conversation.</p>
    pub fn system_message(&self) -> ::std::option::Option<&str> {
        self.system_message.as_deref()
    }
    /// <p>The identifier of an Amazon Q AI generated message within the conversation.</p>
    pub fn system_message_id(&self) -> ::std::option::Option<&str> {
        self.system_message_id.as_deref()
    }
    /// <p>The identifier of an Amazon Q end user text input message within the conversation.</p>
    pub fn user_message_id(&self) -> ::std::option::Option<&str> {
        self.user_message_id.as_deref()
    }
    /// <p>A request from Amazon Q to the end user for information Amazon Q needs to successfully complete a requested plugin action.</p>
    pub fn action_review(&self) -> ::std::option::Option<&crate::types::ActionReview> {
        self.action_review.as_ref()
    }
    /// <p>The source documents used to generate the conversation response.</p>
    ///
    /// 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()`.
    pub fn source_attributions(&self) -> &[::std::option::Option<crate::types::SourceAttribution>] {
        self.source_attributions.as_deref().unwrap_or_default()
    }
    /// <p>A list of files which failed to upload during chat.</p>
    ///
    /// 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()`.
    pub fn failed_attachments(&self) -> &[crate::types::AttachmentOutput] {
        self.failed_attachments.as_deref().unwrap_or_default()
    }
}
impl ::aws_types::request_id::RequestId for ChatSyncOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl ChatSyncOutput {
    /// Creates a new builder-style object to manufacture [`ChatSyncOutput`](crate::operation::chat_sync::ChatSyncOutput).
    pub fn builder() -> crate::operation::chat_sync::builders::ChatSyncOutputBuilder {
        crate::operation::chat_sync::builders::ChatSyncOutputBuilder::default()
    }
}

/// A builder for [`ChatSyncOutput`](crate::operation::chat_sync::ChatSyncOutput).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct ChatSyncOutputBuilder {
    pub(crate) conversation_id: ::std::option::Option<::std::string::String>,
    pub(crate) system_message: ::std::option::Option<::std::string::String>,
    pub(crate) system_message_id: ::std::option::Option<::std::string::String>,
    pub(crate) user_message_id: ::std::option::Option<::std::string::String>,
    pub(crate) action_review: ::std::option::Option<crate::types::ActionReview>,
    pub(crate) source_attributions: ::std::option::Option<::std::vec::Vec<::std::option::Option<crate::types::SourceAttribution>>>,
    pub(crate) failed_attachments: ::std::option::Option<::std::vec::Vec<crate::types::AttachmentOutput>>,
    _request_id: Option<String>,
}
impl ChatSyncOutputBuilder {
    /// <p>The identifier of the Amazon Q conversation.</p>
    pub fn conversation_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.conversation_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The identifier of the Amazon Q conversation.</p>
    pub fn set_conversation_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.conversation_id = input;
        self
    }
    /// <p>The identifier of the Amazon Q conversation.</p>
    pub fn get_conversation_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.conversation_id
    }
    /// <p>An AI-generated message in a conversation.</p>
    pub fn system_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.system_message = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>An AI-generated message in a conversation.</p>
    pub fn set_system_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.system_message = input;
        self
    }
    /// <p>An AI-generated message in a conversation.</p>
    pub fn get_system_message(&self) -> &::std::option::Option<::std::string::String> {
        &self.system_message
    }
    /// <p>The identifier of an Amazon Q AI generated message within the conversation.</p>
    pub fn system_message_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.system_message_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The identifier of an Amazon Q AI generated message within the conversation.</p>
    pub fn set_system_message_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.system_message_id = input;
        self
    }
    /// <p>The identifier of an Amazon Q AI generated message within the conversation.</p>
    pub fn get_system_message_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.system_message_id
    }
    /// <p>The identifier of an Amazon Q end user text input message within the conversation.</p>
    pub fn user_message_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.user_message_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The identifier of an Amazon Q end user text input message within the conversation.</p>
    pub fn set_user_message_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.user_message_id = input;
        self
    }
    /// <p>The identifier of an Amazon Q end user text input message within the conversation.</p>
    pub fn get_user_message_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.user_message_id
    }
    /// <p>A request from Amazon Q to the end user for information Amazon Q needs to successfully complete a requested plugin action.</p>
    pub fn action_review(mut self, input: crate::types::ActionReview) -> Self {
        self.action_review = ::std::option::Option::Some(input);
        self
    }
    /// <p>A request from Amazon Q to the end user for information Amazon Q needs to successfully complete a requested plugin action.</p>
    pub fn set_action_review(mut self, input: ::std::option::Option<crate::types::ActionReview>) -> Self {
        self.action_review = input;
        self
    }
    /// <p>A request from Amazon Q to the end user for information Amazon Q needs to successfully complete a requested plugin action.</p>
    pub fn get_action_review(&self) -> &::std::option::Option<crate::types::ActionReview> {
        &self.action_review
    }
    /// Appends an item to `source_attributions`.
    ///
    /// To override the contents of this collection use [`set_source_attributions`](Self::set_source_attributions).
    ///
    /// <p>The source documents used to generate the conversation response.</p>
    pub fn source_attributions(mut self, input: ::std::option::Option<crate::types::SourceAttribution>) -> Self {
        let mut v = self.source_attributions.unwrap_or_default();
        v.push(input);
        self.source_attributions = ::std::option::Option::Some(v);
        self
    }
    /// <p>The source documents used to generate the conversation response.</p>
    pub fn set_source_attributions(
        mut self,
        input: ::std::option::Option<::std::vec::Vec<::std::option::Option<crate::types::SourceAttribution>>>,
    ) -> Self {
        self.source_attributions = input;
        self
    }
    /// <p>The source documents used to generate the conversation response.</p>
    pub fn get_source_attributions(&self) -> &::std::option::Option<::std::vec::Vec<::std::option::Option<crate::types::SourceAttribution>>> {
        &self.source_attributions
    }
    /// Appends an item to `failed_attachments`.
    ///
    /// To override the contents of this collection use [`set_failed_attachments`](Self::set_failed_attachments).
    ///
    /// <p>A list of files which failed to upload during chat.</p>
    pub fn failed_attachments(mut self, input: crate::types::AttachmentOutput) -> Self {
        let mut v = self.failed_attachments.unwrap_or_default();
        v.push(input);
        self.failed_attachments = ::std::option::Option::Some(v);
        self
    }
    /// <p>A list of files which failed to upload during chat.</p>
    pub fn set_failed_attachments(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AttachmentOutput>>) -> Self {
        self.failed_attachments = input;
        self
    }
    /// <p>A list of files which failed to upload during chat.</p>
    pub fn get_failed_attachments(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AttachmentOutput>> {
        &self.failed_attachments
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`ChatSyncOutput`](crate::operation::chat_sync::ChatSyncOutput).
    pub fn build(self) -> crate::operation::chat_sync::ChatSyncOutput {
        crate::operation::chat_sync::ChatSyncOutput {
            conversation_id: self.conversation_id,
            system_message: self.system_message,
            system_message_id: self.system_message_id,
            user_message_id: self.user_message_id,
            action_review: self.action_review,
            source_attributions: self.source_attributions,
            failed_attachments: self.failed_attachments,
            _request_id: self._request_id,
        }
    }
}