aws_sdk_connectparticipant/operation/send_event/
_send_event_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 SendEventInput {
6    /// <p>The content type of the request. Supported types are:</p>
7    /// <ul>
8    /// <li>
9    /// <p>application/vnd.amazonaws.connect.event.typing</p></li>
10    /// <li>
11    /// <p>application/vnd.amazonaws.connect.event.connection.acknowledged (is no longer maintained since December 31, 2024)</p></li>
12    /// <li>
13    /// <p>application/vnd.amazonaws.connect.event.message.delivered</p></li>
14    /// <li>
15    /// <p>application/vnd.amazonaws.connect.event.message.read</p></li>
16    /// </ul>
17    pub content_type: ::std::option::Option<::std::string::String>,
18    /// <p>The content of the event to be sent (for example, message text). For content related to message receipts, this is supported in the form of a JSON string.</p>
19    /// <p>Sample Content: "{\"messageId\":\"11111111-aaaa-bbbb-cccc-EXAMPLE01234\"}"</p>
20    pub content: ::std::option::Option<::std::string::String>,
21    /// <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>
22    pub client_token: ::std::option::Option<::std::string::String>,
23    /// <p>The authentication token associated with the participant's connection.</p>
24    pub connection_token: ::std::option::Option<::std::string::String>,
25}
26impl SendEventInput {
27    /// <p>The content type of the request. Supported types are:</p>
28    /// <ul>
29    /// <li>
30    /// <p>application/vnd.amazonaws.connect.event.typing</p></li>
31    /// <li>
32    /// <p>application/vnd.amazonaws.connect.event.connection.acknowledged (is no longer maintained since December 31, 2024)</p></li>
33    /// <li>
34    /// <p>application/vnd.amazonaws.connect.event.message.delivered</p></li>
35    /// <li>
36    /// <p>application/vnd.amazonaws.connect.event.message.read</p></li>
37    /// </ul>
38    pub fn content_type(&self) -> ::std::option::Option<&str> {
39        self.content_type.as_deref()
40    }
41    /// <p>The content of the event to be sent (for example, message text). For content related to message receipts, this is supported in the form of a JSON string.</p>
42    /// <p>Sample Content: "{\"messageId\":\"11111111-aaaa-bbbb-cccc-EXAMPLE01234\"}"</p>
43    pub fn content(&self) -> ::std::option::Option<&str> {
44        self.content.as_deref()
45    }
46    /// <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>
47    pub fn client_token(&self) -> ::std::option::Option<&str> {
48        self.client_token.as_deref()
49    }
50    /// <p>The authentication token associated with the participant's connection.</p>
51    pub fn connection_token(&self) -> ::std::option::Option<&str> {
52        self.connection_token.as_deref()
53    }
54}
55impl SendEventInput {
56    /// Creates a new builder-style object to manufacture [`SendEventInput`](crate::operation::send_event::SendEventInput).
57    pub fn builder() -> crate::operation::send_event::builders::SendEventInputBuilder {
58        crate::operation::send_event::builders::SendEventInputBuilder::default()
59    }
60}
61
62/// A builder for [`SendEventInput`](crate::operation::send_event::SendEventInput).
63#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
64#[non_exhaustive]
65pub struct SendEventInputBuilder {
66    pub(crate) content_type: ::std::option::Option<::std::string::String>,
67    pub(crate) content: ::std::option::Option<::std::string::String>,
68    pub(crate) client_token: ::std::option::Option<::std::string::String>,
69    pub(crate) connection_token: ::std::option::Option<::std::string::String>,
70}
71impl SendEventInputBuilder {
72    /// <p>The content type of the request. Supported types are:</p>
73    /// <ul>
74    /// <li>
75    /// <p>application/vnd.amazonaws.connect.event.typing</p></li>
76    /// <li>
77    /// <p>application/vnd.amazonaws.connect.event.connection.acknowledged (is no longer maintained since December 31, 2024)</p></li>
78    /// <li>
79    /// <p>application/vnd.amazonaws.connect.event.message.delivered</p></li>
80    /// <li>
81    /// <p>application/vnd.amazonaws.connect.event.message.read</p></li>
82    /// </ul>
83    /// This field is required.
84    pub fn content_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
85        self.content_type = ::std::option::Option::Some(input.into());
86        self
87    }
88    /// <p>The content type of the request. Supported types are:</p>
89    /// <ul>
90    /// <li>
91    /// <p>application/vnd.amazonaws.connect.event.typing</p></li>
92    /// <li>
93    /// <p>application/vnd.amazonaws.connect.event.connection.acknowledged (is no longer maintained since December 31, 2024)</p></li>
94    /// <li>
95    /// <p>application/vnd.amazonaws.connect.event.message.delivered</p></li>
96    /// <li>
97    /// <p>application/vnd.amazonaws.connect.event.message.read</p></li>
98    /// </ul>
99    pub fn set_content_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
100        self.content_type = input;
101        self
102    }
103    /// <p>The content type of the request. Supported types are:</p>
104    /// <ul>
105    /// <li>
106    /// <p>application/vnd.amazonaws.connect.event.typing</p></li>
107    /// <li>
108    /// <p>application/vnd.amazonaws.connect.event.connection.acknowledged (is no longer maintained since December 31, 2024)</p></li>
109    /// <li>
110    /// <p>application/vnd.amazonaws.connect.event.message.delivered</p></li>
111    /// <li>
112    /// <p>application/vnd.amazonaws.connect.event.message.read</p></li>
113    /// </ul>
114    pub fn get_content_type(&self) -> &::std::option::Option<::std::string::String> {
115        &self.content_type
116    }
117    /// <p>The content of the event to be sent (for example, message text). For content related to message receipts, this is supported in the form of a JSON string.</p>
118    /// <p>Sample Content: "{\"messageId\":\"11111111-aaaa-bbbb-cccc-EXAMPLE01234\"}"</p>
119    pub fn content(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
120        self.content = ::std::option::Option::Some(input.into());
121        self
122    }
123    /// <p>The content of the event to be sent (for example, message text). For content related to message receipts, this is supported in the form of a JSON string.</p>
124    /// <p>Sample Content: "{\"messageId\":\"11111111-aaaa-bbbb-cccc-EXAMPLE01234\"}"</p>
125    pub fn set_content(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
126        self.content = input;
127        self
128    }
129    /// <p>The content of the event to be sent (for example, message text). For content related to message receipts, this is supported in the form of a JSON string.</p>
130    /// <p>Sample Content: "{\"messageId\":\"11111111-aaaa-bbbb-cccc-EXAMPLE01234\"}"</p>
131    pub fn get_content(&self) -> &::std::option::Option<::std::string::String> {
132        &self.content
133    }
134    /// <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>
135    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
136        self.client_token = ::std::option::Option::Some(input.into());
137        self
138    }
139    /// <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>
140    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
141        self.client_token = input;
142        self
143    }
144    /// <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>
145    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
146        &self.client_token
147    }
148    /// <p>The authentication token associated with the participant's connection.</p>
149    /// This field is required.
150    pub fn connection_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
151        self.connection_token = ::std::option::Option::Some(input.into());
152        self
153    }
154    /// <p>The authentication token associated with the participant's connection.</p>
155    pub fn set_connection_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
156        self.connection_token = input;
157        self
158    }
159    /// <p>The authentication token associated with the participant's connection.</p>
160    pub fn get_connection_token(&self) -> &::std::option::Option<::std::string::String> {
161        &self.connection_token
162    }
163    /// Consumes the builder and constructs a [`SendEventInput`](crate::operation::send_event::SendEventInput).
164    pub fn build(self) -> ::std::result::Result<crate::operation::send_event::SendEventInput, ::aws_smithy_types::error::operation::BuildError> {
165        ::std::result::Result::Ok(crate::operation::send_event::SendEventInput {
166            content_type: self.content_type,
167            content: self.content,
168            client_token: self.client_token,
169            connection_token: self.connection_token,
170        })
171    }
172}