aws_sdk_qconnect/operation/send_message/
_send_message_input.rs

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
// 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 SendMessageInput {
    /// <p>The identifier of the Amazon Q in Connect assistant.</p>
    pub assistant_id: ::std::option::Option<::std::string::String>,
    /// <p>The identifier of the Amazon Q in Connect session.</p>
    pub session_id: ::std::option::Option<::std::string::String>,
    /// <p>The message type.</p>
    pub r#type: ::std::option::Option<crate::types::MessageType>,
    /// <p>The message data to submit to the Amazon Q in Connect session.</p>
    pub message: ::std::option::Option<crate::types::MessageInput>,
    /// <p>The conversation context before the Amazon Q in Connect session.</p>
    pub conversation_context: ::std::option::Option<crate::types::ConversationContext>,
    /// <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>
    pub client_token: ::std::option::Option<::std::string::String>,
}
impl SendMessageInput {
    /// <p>The identifier of the Amazon Q in Connect assistant.</p>
    pub fn assistant_id(&self) -> ::std::option::Option<&str> {
        self.assistant_id.as_deref()
    }
    /// <p>The identifier of the Amazon Q in Connect session.</p>
    pub fn session_id(&self) -> ::std::option::Option<&str> {
        self.session_id.as_deref()
    }
    /// <p>The message type.</p>
    pub fn r#type(&self) -> ::std::option::Option<&crate::types::MessageType> {
        self.r#type.as_ref()
    }
    /// <p>The message data to submit to the Amazon Q in Connect session.</p>
    pub fn message(&self) -> ::std::option::Option<&crate::types::MessageInput> {
        self.message.as_ref()
    }
    /// <p>The conversation context before the Amazon Q in Connect session.</p>
    pub fn conversation_context(&self) -> ::std::option::Option<&crate::types::ConversationContext> {
        self.conversation_context.as_ref()
    }
    /// <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>
    pub fn client_token(&self) -> ::std::option::Option<&str> {
        self.client_token.as_deref()
    }
}
impl SendMessageInput {
    /// Creates a new builder-style object to manufacture [`SendMessageInput`](crate::operation::send_message::SendMessageInput).
    pub fn builder() -> crate::operation::send_message::builders::SendMessageInputBuilder {
        crate::operation::send_message::builders::SendMessageInputBuilder::default()
    }
}

/// A builder for [`SendMessageInput`](crate::operation::send_message::SendMessageInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct SendMessageInputBuilder {
    pub(crate) assistant_id: ::std::option::Option<::std::string::String>,
    pub(crate) session_id: ::std::option::Option<::std::string::String>,
    pub(crate) r#type: ::std::option::Option<crate::types::MessageType>,
    pub(crate) message: ::std::option::Option<crate::types::MessageInput>,
    pub(crate) conversation_context: ::std::option::Option<crate::types::ConversationContext>,
    pub(crate) client_token: ::std::option::Option<::std::string::String>,
}
impl SendMessageInputBuilder {
    /// <p>The identifier of the Amazon Q in Connect assistant.</p>
    /// This field is required.
    pub fn assistant_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.assistant_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The identifier of the Amazon Q in Connect assistant.</p>
    pub fn set_assistant_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.assistant_id = input;
        self
    }
    /// <p>The identifier of the Amazon Q in Connect assistant.</p>
    pub fn get_assistant_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.assistant_id
    }
    /// <p>The identifier of the Amazon Q in Connect session.</p>
    /// This field is required.
    pub fn session_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.session_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The identifier of the Amazon Q in Connect session.</p>
    pub fn set_session_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.session_id = input;
        self
    }
    /// <p>The identifier of the Amazon Q in Connect session.</p>
    pub fn get_session_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.session_id
    }
    /// <p>The message type.</p>
    /// This field is required.
    pub fn r#type(mut self, input: crate::types::MessageType) -> Self {
        self.r#type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The message type.</p>
    pub fn set_type(mut self, input: ::std::option::Option<crate::types::MessageType>) -> Self {
        self.r#type = input;
        self
    }
    /// <p>The message type.</p>
    pub fn get_type(&self) -> &::std::option::Option<crate::types::MessageType> {
        &self.r#type
    }
    /// <p>The message data to submit to the Amazon Q in Connect session.</p>
    /// This field is required.
    pub fn message(mut self, input: crate::types::MessageInput) -> Self {
        self.message = ::std::option::Option::Some(input);
        self
    }
    /// <p>The message data to submit to the Amazon Q in Connect session.</p>
    pub fn set_message(mut self, input: ::std::option::Option<crate::types::MessageInput>) -> Self {
        self.message = input;
        self
    }
    /// <p>The message data to submit to the Amazon Q in Connect session.</p>
    pub fn get_message(&self) -> &::std::option::Option<crate::types::MessageInput> {
        &self.message
    }
    /// <p>The conversation context before the Amazon Q in Connect session.</p>
    pub fn conversation_context(mut self, input: crate::types::ConversationContext) -> Self {
        self.conversation_context = ::std::option::Option::Some(input);
        self
    }
    /// <p>The conversation context before the Amazon Q in Connect session.</p>
    pub fn set_conversation_context(mut self, input: ::std::option::Option<crate::types::ConversationContext>) -> Self {
        self.conversation_context = input;
        self
    }
    /// <p>The conversation context before the Amazon Q in Connect session.</p>
    pub fn get_conversation_context(&self) -> &::std::option::Option<crate::types::ConversationContext> {
        &self.conversation_context
    }
    /// <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>
    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.client_token = ::std::option::Option::Some(input.into());
        self
    }
    /// <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>
    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.client_token = input;
        self
    }
    /// <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>
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.client_token
    }
    /// Consumes the builder and constructs a [`SendMessageInput`](crate::operation::send_message::SendMessageInput).
    pub fn build(self) -> ::std::result::Result<crate::operation::send_message::SendMessageInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::send_message::SendMessageInput {
            assistant_id: self.assistant_id,
            session_id: self.session_id,
            r#type: self.r#type,
            message: self.message,
            conversation_context: self.conversation_context,
            client_token: self.client_token,
        })
    }
}