aws_sdk_qconnect/operation/send_message/
_send_message_input.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 SendMessageInput {
6    /// <p>The identifier of the Amazon Q in Connect assistant.</p>
7    pub assistant_id: ::std::option::Option<::std::string::String>,
8    /// <p>The identifier of the Amazon Q in Connect session.</p>
9    pub session_id: ::std::option::Option<::std::string::String>,
10    /// <p>The message type.</p>
11    pub r#type: ::std::option::Option<crate::types::MessageType>,
12    /// <p>The message data to submit to the Amazon Q in Connect session.</p>
13    pub message: ::std::option::Option<crate::types::MessageInput>,
14    /// <p>The identifier of the AI Agent to use for processing the message.</p>
15    pub ai_agent_id: ::std::option::Option<::std::string::String>,
16    /// <p>The conversation context before the Amazon Q in Connect session.</p>
17    pub conversation_context: ::std::option::Option<crate::types::ConversationContext>,
18    /// <p>The configuration of the <a href="https://docs.aws.amazon.com/connect/latest/APIReference/API_amazon-q-connect_SendMessage.html">SendMessage</a> request.</p>
19    pub configuration: ::std::option::Option<crate::types::MessageConfiguration>,
20    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the AWS SDK populates this field.For more information about idempotency, see Making retries safe with idempotent APIs.</p>
21    pub client_token: ::std::option::Option<::std::string::String>,
22    /// <p>The orchestrator use case for message processing.</p>
23    pub orchestrator_use_case: ::std::option::Option<::std::string::String>,
24    /// <p>Additional metadata for the message.</p>
25    pub metadata: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
26}
27impl SendMessageInput {
28    /// <p>The identifier of the Amazon Q in Connect assistant.</p>
29    pub fn assistant_id(&self) -> ::std::option::Option<&str> {
30        self.assistant_id.as_deref()
31    }
32    /// <p>The identifier of the Amazon Q in Connect session.</p>
33    pub fn session_id(&self) -> ::std::option::Option<&str> {
34        self.session_id.as_deref()
35    }
36    /// <p>The message type.</p>
37    pub fn r#type(&self) -> ::std::option::Option<&crate::types::MessageType> {
38        self.r#type.as_ref()
39    }
40    /// <p>The message data to submit to the Amazon Q in Connect session.</p>
41    pub fn message(&self) -> ::std::option::Option<&crate::types::MessageInput> {
42        self.message.as_ref()
43    }
44    /// <p>The identifier of the AI Agent to use for processing the message.</p>
45    pub fn ai_agent_id(&self) -> ::std::option::Option<&str> {
46        self.ai_agent_id.as_deref()
47    }
48    /// <p>The conversation context before the Amazon Q in Connect session.</p>
49    pub fn conversation_context(&self) -> ::std::option::Option<&crate::types::ConversationContext> {
50        self.conversation_context.as_ref()
51    }
52    /// <p>The configuration of the <a href="https://docs.aws.amazon.com/connect/latest/APIReference/API_amazon-q-connect_SendMessage.html">SendMessage</a> request.</p>
53    pub fn configuration(&self) -> ::std::option::Option<&crate::types::MessageConfiguration> {
54        self.configuration.as_ref()
55    }
56    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the AWS SDK populates this field.For more information about idempotency, see Making retries safe with idempotent APIs.</p>
57    pub fn client_token(&self) -> ::std::option::Option<&str> {
58        self.client_token.as_deref()
59    }
60    /// <p>The orchestrator use case for message processing.</p>
61    pub fn orchestrator_use_case(&self) -> ::std::option::Option<&str> {
62        self.orchestrator_use_case.as_deref()
63    }
64    /// <p>Additional metadata for the message.</p>
65    pub fn metadata(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
66        self.metadata.as_ref()
67    }
68}
69impl SendMessageInput {
70    /// Creates a new builder-style object to manufacture [`SendMessageInput`](crate::operation::send_message::SendMessageInput).
71    pub fn builder() -> crate::operation::send_message::builders::SendMessageInputBuilder {
72        crate::operation::send_message::builders::SendMessageInputBuilder::default()
73    }
74}
75
76/// A builder for [`SendMessageInput`](crate::operation::send_message::SendMessageInput).
77#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
78#[non_exhaustive]
79pub struct SendMessageInputBuilder {
80    pub(crate) assistant_id: ::std::option::Option<::std::string::String>,
81    pub(crate) session_id: ::std::option::Option<::std::string::String>,
82    pub(crate) r#type: ::std::option::Option<crate::types::MessageType>,
83    pub(crate) message: ::std::option::Option<crate::types::MessageInput>,
84    pub(crate) ai_agent_id: ::std::option::Option<::std::string::String>,
85    pub(crate) conversation_context: ::std::option::Option<crate::types::ConversationContext>,
86    pub(crate) configuration: ::std::option::Option<crate::types::MessageConfiguration>,
87    pub(crate) client_token: ::std::option::Option<::std::string::String>,
88    pub(crate) orchestrator_use_case: ::std::option::Option<::std::string::String>,
89    pub(crate) metadata: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
90}
91impl SendMessageInputBuilder {
92    /// <p>The identifier of the Amazon Q in Connect assistant.</p>
93    /// This field is required.
94    pub fn assistant_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
95        self.assistant_id = ::std::option::Option::Some(input.into());
96        self
97    }
98    /// <p>The identifier of the Amazon Q in Connect assistant.</p>
99    pub fn set_assistant_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
100        self.assistant_id = input;
101        self
102    }
103    /// <p>The identifier of the Amazon Q in Connect assistant.</p>
104    pub fn get_assistant_id(&self) -> &::std::option::Option<::std::string::String> {
105        &self.assistant_id
106    }
107    /// <p>The identifier of the Amazon Q in Connect session.</p>
108    /// This field is required.
109    pub fn session_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
110        self.session_id = ::std::option::Option::Some(input.into());
111        self
112    }
113    /// <p>The identifier of the Amazon Q in Connect session.</p>
114    pub fn set_session_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
115        self.session_id = input;
116        self
117    }
118    /// <p>The identifier of the Amazon Q in Connect session.</p>
119    pub fn get_session_id(&self) -> &::std::option::Option<::std::string::String> {
120        &self.session_id
121    }
122    /// <p>The message type.</p>
123    /// This field is required.
124    pub fn r#type(mut self, input: crate::types::MessageType) -> Self {
125        self.r#type = ::std::option::Option::Some(input);
126        self
127    }
128    /// <p>The message type.</p>
129    pub fn set_type(mut self, input: ::std::option::Option<crate::types::MessageType>) -> Self {
130        self.r#type = input;
131        self
132    }
133    /// <p>The message type.</p>
134    pub fn get_type(&self) -> &::std::option::Option<crate::types::MessageType> {
135        &self.r#type
136    }
137    /// <p>The message data to submit to the Amazon Q in Connect session.</p>
138    /// This field is required.
139    pub fn message(mut self, input: crate::types::MessageInput) -> Self {
140        self.message = ::std::option::Option::Some(input);
141        self
142    }
143    /// <p>The message data to submit to the Amazon Q in Connect session.</p>
144    pub fn set_message(mut self, input: ::std::option::Option<crate::types::MessageInput>) -> Self {
145        self.message = input;
146        self
147    }
148    /// <p>The message data to submit to the Amazon Q in Connect session.</p>
149    pub fn get_message(&self) -> &::std::option::Option<crate::types::MessageInput> {
150        &self.message
151    }
152    /// <p>The identifier of the AI Agent to use for processing the message.</p>
153    pub fn ai_agent_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
154        self.ai_agent_id = ::std::option::Option::Some(input.into());
155        self
156    }
157    /// <p>The identifier of the AI Agent to use for processing the message.</p>
158    pub fn set_ai_agent_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
159        self.ai_agent_id = input;
160        self
161    }
162    /// <p>The identifier of the AI Agent to use for processing the message.</p>
163    pub fn get_ai_agent_id(&self) -> &::std::option::Option<::std::string::String> {
164        &self.ai_agent_id
165    }
166    /// <p>The conversation context before the Amazon Q in Connect session.</p>
167    pub fn conversation_context(mut self, input: crate::types::ConversationContext) -> Self {
168        self.conversation_context = ::std::option::Option::Some(input);
169        self
170    }
171    /// <p>The conversation context before the Amazon Q in Connect session.</p>
172    pub fn set_conversation_context(mut self, input: ::std::option::Option<crate::types::ConversationContext>) -> Self {
173        self.conversation_context = input;
174        self
175    }
176    /// <p>The conversation context before the Amazon Q in Connect session.</p>
177    pub fn get_conversation_context(&self) -> &::std::option::Option<crate::types::ConversationContext> {
178        &self.conversation_context
179    }
180    /// <p>The configuration of the <a href="https://docs.aws.amazon.com/connect/latest/APIReference/API_amazon-q-connect_SendMessage.html">SendMessage</a> request.</p>
181    pub fn configuration(mut self, input: crate::types::MessageConfiguration) -> Self {
182        self.configuration = ::std::option::Option::Some(input);
183        self
184    }
185    /// <p>The configuration of the <a href="https://docs.aws.amazon.com/connect/latest/APIReference/API_amazon-q-connect_SendMessage.html">SendMessage</a> request.</p>
186    pub fn set_configuration(mut self, input: ::std::option::Option<crate::types::MessageConfiguration>) -> Self {
187        self.configuration = input;
188        self
189    }
190    /// <p>The configuration of the <a href="https://docs.aws.amazon.com/connect/latest/APIReference/API_amazon-q-connect_SendMessage.html">SendMessage</a> request.</p>
191    pub fn get_configuration(&self) -> &::std::option::Option<crate::types::MessageConfiguration> {
192        &self.configuration
193    }
194    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the AWS SDK populates this field.For more information about idempotency, see Making retries safe with idempotent APIs.</p>
195    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
196        self.client_token = ::std::option::Option::Some(input.into());
197        self
198    }
199    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the AWS SDK populates this field.For more information about idempotency, see Making retries safe with idempotent APIs.</p>
200    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
201        self.client_token = input;
202        self
203    }
204    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the AWS SDK populates this field.For more information about idempotency, see Making retries safe with idempotent APIs.</p>
205    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
206        &self.client_token
207    }
208    /// <p>The orchestrator use case for message processing.</p>
209    pub fn orchestrator_use_case(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
210        self.orchestrator_use_case = ::std::option::Option::Some(input.into());
211        self
212    }
213    /// <p>The orchestrator use case for message processing.</p>
214    pub fn set_orchestrator_use_case(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
215        self.orchestrator_use_case = input;
216        self
217    }
218    /// <p>The orchestrator use case for message processing.</p>
219    pub fn get_orchestrator_use_case(&self) -> &::std::option::Option<::std::string::String> {
220        &self.orchestrator_use_case
221    }
222    /// Adds a key-value pair to `metadata`.
223    ///
224    /// To override the contents of this collection use [`set_metadata`](Self::set_metadata).
225    ///
226    /// <p>Additional metadata for the message.</p>
227    pub fn metadata(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
228        let mut hash_map = self.metadata.unwrap_or_default();
229        hash_map.insert(k.into(), v.into());
230        self.metadata = ::std::option::Option::Some(hash_map);
231        self
232    }
233    /// <p>Additional metadata for the message.</p>
234    pub fn set_metadata(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
235        self.metadata = input;
236        self
237    }
238    /// <p>Additional metadata for the message.</p>
239    pub fn get_metadata(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
240        &self.metadata
241    }
242    /// Consumes the builder and constructs a [`SendMessageInput`](crate::operation::send_message::SendMessageInput).
243    pub fn build(self) -> ::std::result::Result<crate::operation::send_message::SendMessageInput, ::aws_smithy_types::error::operation::BuildError> {
244        ::std::result::Result::Ok(crate::operation::send_message::SendMessageInput {
245            assistant_id: self.assistant_id,
246            session_id: self.session_id,
247            r#type: self.r#type,
248            message: self.message,
249            ai_agent_id: self.ai_agent_id,
250            conversation_context: self.conversation_context,
251            configuration: self.configuration,
252            client_token: self.client_token,
253            orchestrator_use_case: self.orchestrator_use_case,
254            metadata: self.metadata,
255        })
256    }
257}