aws_sdk_connectparticipant/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 type of the content. Possible types are <code>text/plain</code>, <code>text/markdown</code>, <code>application/json</code>, and <code>application/vnd.amazonaws.connect.message.interactive.response</code>.</p>
7 /// <p>Supported types on the contact are configured through <code>SupportedMessagingContentTypes</code> on <a href="https://docs.aws.amazon.com/connect/latest/APIReference/API_StartChatContact.html">StartChatContact</a> and <a href="https://docs.aws.amazon.com/connect/latest/APIReference/API_StartOutboundChatContact.html">StartOutboundChatContact</a>.</p>
8 /// <p>For Apple Messages for Business, SMS, and WhatsApp Business Messaging contacts, only <code>text/plain</code> is supported.</p>
9 pub content_type: ::std::option::Option<::std::string::String>,
10 /// <p>The content of the message.</p>
11 /// <ul>
12 /// <li>
13 /// <p>For <code>text/plain</code> and <code>text/markdown</code>, the Length Constraints are Minimum of 1, Maximum of 1024.</p></li>
14 /// <li>
15 /// <p>For <code>application/json</code>, the Length Constraints are Minimum of 1, Maximum of 12000.</p></li>
16 /// <li>
17 /// <p>For <code>application/vnd.amazonaws.connect.message.interactive.response</code>, the Length Constraints are Minimum of 1, Maximum of 12288.</p></li>
18 /// </ul>
19 pub content: ::std::option::Option<::std::string::String>,
20 /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see <a href="https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>.</p>
21 pub client_token: ::std::option::Option<::std::string::String>,
22 /// <p>The authentication token associated with the connection.</p>
23 pub connection_token: ::std::option::Option<::std::string::String>,
24}
25impl SendMessageInput {
26 /// <p>The type of the content. Possible types are <code>text/plain</code>, <code>text/markdown</code>, <code>application/json</code>, and <code>application/vnd.amazonaws.connect.message.interactive.response</code>.</p>
27 /// <p>Supported types on the contact are configured through <code>SupportedMessagingContentTypes</code> on <a href="https://docs.aws.amazon.com/connect/latest/APIReference/API_StartChatContact.html">StartChatContact</a> and <a href="https://docs.aws.amazon.com/connect/latest/APIReference/API_StartOutboundChatContact.html">StartOutboundChatContact</a>.</p>
28 /// <p>For Apple Messages for Business, SMS, and WhatsApp Business Messaging contacts, only <code>text/plain</code> is supported.</p>
29 pub fn content_type(&self) -> ::std::option::Option<&str> {
30 self.content_type.as_deref()
31 }
32 /// <p>The content of the message.</p>
33 /// <ul>
34 /// <li>
35 /// <p>For <code>text/plain</code> and <code>text/markdown</code>, the Length Constraints are Minimum of 1, Maximum of 1024.</p></li>
36 /// <li>
37 /// <p>For <code>application/json</code>, the Length Constraints are Minimum of 1, Maximum of 12000.</p></li>
38 /// <li>
39 /// <p>For <code>application/vnd.amazonaws.connect.message.interactive.response</code>, the Length Constraints are Minimum of 1, Maximum of 12288.</p></li>
40 /// </ul>
41 pub fn content(&self) -> ::std::option::Option<&str> {
42 self.content.as_deref()
43 }
44 /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see <a href="https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>.</p>
45 pub fn client_token(&self) -> ::std::option::Option<&str> {
46 self.client_token.as_deref()
47 }
48 /// <p>The authentication token associated with the connection.</p>
49 pub fn connection_token(&self) -> ::std::option::Option<&str> {
50 self.connection_token.as_deref()
51 }
52}
53impl SendMessageInput {
54 /// Creates a new builder-style object to manufacture [`SendMessageInput`](crate::operation::send_message::SendMessageInput).
55 pub fn builder() -> crate::operation::send_message::builders::SendMessageInputBuilder {
56 crate::operation::send_message::builders::SendMessageInputBuilder::default()
57 }
58}
59
60/// A builder for [`SendMessageInput`](crate::operation::send_message::SendMessageInput).
61#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
62#[non_exhaustive]
63pub struct SendMessageInputBuilder {
64 pub(crate) content_type: ::std::option::Option<::std::string::String>,
65 pub(crate) content: ::std::option::Option<::std::string::String>,
66 pub(crate) client_token: ::std::option::Option<::std::string::String>,
67 pub(crate) connection_token: ::std::option::Option<::std::string::String>,
68}
69impl SendMessageInputBuilder {
70 /// <p>The type of the content. Possible types are <code>text/plain</code>, <code>text/markdown</code>, <code>application/json</code>, and <code>application/vnd.amazonaws.connect.message.interactive.response</code>.</p>
71 /// <p>Supported types on the contact are configured through <code>SupportedMessagingContentTypes</code> on <a href="https://docs.aws.amazon.com/connect/latest/APIReference/API_StartChatContact.html">StartChatContact</a> and <a href="https://docs.aws.amazon.com/connect/latest/APIReference/API_StartOutboundChatContact.html">StartOutboundChatContact</a>.</p>
72 /// <p>For Apple Messages for Business, SMS, and WhatsApp Business Messaging contacts, only <code>text/plain</code> is supported.</p>
73 /// This field is required.
74 pub fn content_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
75 self.content_type = ::std::option::Option::Some(input.into());
76 self
77 }
78 /// <p>The type of the content. Possible types are <code>text/plain</code>, <code>text/markdown</code>, <code>application/json</code>, and <code>application/vnd.amazonaws.connect.message.interactive.response</code>.</p>
79 /// <p>Supported types on the contact are configured through <code>SupportedMessagingContentTypes</code> on <a href="https://docs.aws.amazon.com/connect/latest/APIReference/API_StartChatContact.html">StartChatContact</a> and <a href="https://docs.aws.amazon.com/connect/latest/APIReference/API_StartOutboundChatContact.html">StartOutboundChatContact</a>.</p>
80 /// <p>For Apple Messages for Business, SMS, and WhatsApp Business Messaging contacts, only <code>text/plain</code> is supported.</p>
81 pub fn set_content_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
82 self.content_type = input;
83 self
84 }
85 /// <p>The type of the content. Possible types are <code>text/plain</code>, <code>text/markdown</code>, <code>application/json</code>, and <code>application/vnd.amazonaws.connect.message.interactive.response</code>.</p>
86 /// <p>Supported types on the contact are configured through <code>SupportedMessagingContentTypes</code> on <a href="https://docs.aws.amazon.com/connect/latest/APIReference/API_StartChatContact.html">StartChatContact</a> and <a href="https://docs.aws.amazon.com/connect/latest/APIReference/API_StartOutboundChatContact.html">StartOutboundChatContact</a>.</p>
87 /// <p>For Apple Messages for Business, SMS, and WhatsApp Business Messaging contacts, only <code>text/plain</code> is supported.</p>
88 pub fn get_content_type(&self) -> &::std::option::Option<::std::string::String> {
89 &self.content_type
90 }
91 /// <p>The content of the message.</p>
92 /// <ul>
93 /// <li>
94 /// <p>For <code>text/plain</code> and <code>text/markdown</code>, the Length Constraints are Minimum of 1, Maximum of 1024.</p></li>
95 /// <li>
96 /// <p>For <code>application/json</code>, the Length Constraints are Minimum of 1, Maximum of 12000.</p></li>
97 /// <li>
98 /// <p>For <code>application/vnd.amazonaws.connect.message.interactive.response</code>, the Length Constraints are Minimum of 1, Maximum of 12288.</p></li>
99 /// </ul>
100 /// This field is required.
101 pub fn content(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
102 self.content = ::std::option::Option::Some(input.into());
103 self
104 }
105 /// <p>The content of the message.</p>
106 /// <ul>
107 /// <li>
108 /// <p>For <code>text/plain</code> and <code>text/markdown</code>, the Length Constraints are Minimum of 1, Maximum of 1024.</p></li>
109 /// <li>
110 /// <p>For <code>application/json</code>, the Length Constraints are Minimum of 1, Maximum of 12000.</p></li>
111 /// <li>
112 /// <p>For <code>application/vnd.amazonaws.connect.message.interactive.response</code>, the Length Constraints are Minimum of 1, Maximum of 12288.</p></li>
113 /// </ul>
114 pub fn set_content(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
115 self.content = input;
116 self
117 }
118 /// <p>The content of the message.</p>
119 /// <ul>
120 /// <li>
121 /// <p>For <code>text/plain</code> and <code>text/markdown</code>, the Length Constraints are Minimum of 1, Maximum of 1024.</p></li>
122 /// <li>
123 /// <p>For <code>application/json</code>, the Length Constraints are Minimum of 1, Maximum of 12000.</p></li>
124 /// <li>
125 /// <p>For <code>application/vnd.amazonaws.connect.message.interactive.response</code>, the Length Constraints are Minimum of 1, Maximum of 12288.</p></li>
126 /// </ul>
127 pub fn get_content(&self) -> &::std::option::Option<::std::string::String> {
128 &self.content
129 }
130 /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see <a href="https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>.</p>
131 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
132 self.client_token = ::std::option::Option::Some(input.into());
133 self
134 }
135 /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see <a href="https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>.</p>
136 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
137 self.client_token = input;
138 self
139 }
140 /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see <a href="https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>.</p>
141 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
142 &self.client_token
143 }
144 /// <p>The authentication token associated with the connection.</p>
145 /// This field is required.
146 pub fn connection_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
147 self.connection_token = ::std::option::Option::Some(input.into());
148 self
149 }
150 /// <p>The authentication token associated with the connection.</p>
151 pub fn set_connection_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
152 self.connection_token = input;
153 self
154 }
155 /// <p>The authentication token associated with the connection.</p>
156 pub fn get_connection_token(&self) -> &::std::option::Option<::std::string::String> {
157 &self.connection_token
158 }
159 /// Consumes the builder and constructs a [`SendMessageInput`](crate::operation::send_message::SendMessageInput).
160 pub fn build(self) -> ::std::result::Result<crate::operation::send_message::SendMessageInput, ::aws_smithy_types::error::operation::BuildError> {
161 ::std::result::Result::Ok(crate::operation::send_message::SendMessageInput {
162 content_type: self.content_type,
163 content: self.content,
164 client_token: self.client_token,
165 connection_token: self.connection_token,
166 })
167 }
168}