aws_sdk_qconnect/operation/send_message/
_send_message_output.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 SendMessageOutput {
6    /// <p>The identifier of the submitted message.</p>
7    pub request_message_id: ::std::string::String,
8    /// <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>
9    pub configuration: ::std::option::Option<crate::types::MessageConfiguration>,
10    /// <p>The token for the next message, used by GetNextMessage.</p>
11    pub next_message_token: ::std::string::String,
12    _request_id: Option<String>,
13}
14impl SendMessageOutput {
15    /// <p>The identifier of the submitted message.</p>
16    pub fn request_message_id(&self) -> &str {
17        use std::ops::Deref;
18        self.request_message_id.deref()
19    }
20    /// <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>
21    pub fn configuration(&self) -> ::std::option::Option<&crate::types::MessageConfiguration> {
22        self.configuration.as_ref()
23    }
24    /// <p>The token for the next message, used by GetNextMessage.</p>
25    pub fn next_message_token(&self) -> &str {
26        use std::ops::Deref;
27        self.next_message_token.deref()
28    }
29}
30impl ::aws_types::request_id::RequestId for SendMessageOutput {
31    fn request_id(&self) -> Option<&str> {
32        self._request_id.as_deref()
33    }
34}
35impl SendMessageOutput {
36    /// Creates a new builder-style object to manufacture [`SendMessageOutput`](crate::operation::send_message::SendMessageOutput).
37    pub fn builder() -> crate::operation::send_message::builders::SendMessageOutputBuilder {
38        crate::operation::send_message::builders::SendMessageOutputBuilder::default()
39    }
40}
41
42/// A builder for [`SendMessageOutput`](crate::operation::send_message::SendMessageOutput).
43#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
44#[non_exhaustive]
45pub struct SendMessageOutputBuilder {
46    pub(crate) request_message_id: ::std::option::Option<::std::string::String>,
47    pub(crate) configuration: ::std::option::Option<crate::types::MessageConfiguration>,
48    pub(crate) next_message_token: ::std::option::Option<::std::string::String>,
49    _request_id: Option<String>,
50}
51impl SendMessageOutputBuilder {
52    /// <p>The identifier of the submitted message.</p>
53    /// This field is required.
54    pub fn request_message_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
55        self.request_message_id = ::std::option::Option::Some(input.into());
56        self
57    }
58    /// <p>The identifier of the submitted message.</p>
59    pub fn set_request_message_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
60        self.request_message_id = input;
61        self
62    }
63    /// <p>The identifier of the submitted message.</p>
64    pub fn get_request_message_id(&self) -> &::std::option::Option<::std::string::String> {
65        &self.request_message_id
66    }
67    /// <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>
68    pub fn configuration(mut self, input: crate::types::MessageConfiguration) -> Self {
69        self.configuration = ::std::option::Option::Some(input);
70        self
71    }
72    /// <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>
73    pub fn set_configuration(mut self, input: ::std::option::Option<crate::types::MessageConfiguration>) -> Self {
74        self.configuration = input;
75        self
76    }
77    /// <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>
78    pub fn get_configuration(&self) -> &::std::option::Option<crate::types::MessageConfiguration> {
79        &self.configuration
80    }
81    /// <p>The token for the next message, used by GetNextMessage.</p>
82    /// This field is required.
83    pub fn next_message_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
84        self.next_message_token = ::std::option::Option::Some(input.into());
85        self
86    }
87    /// <p>The token for the next message, used by GetNextMessage.</p>
88    pub fn set_next_message_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
89        self.next_message_token = input;
90        self
91    }
92    /// <p>The token for the next message, used by GetNextMessage.</p>
93    pub fn get_next_message_token(&self) -> &::std::option::Option<::std::string::String> {
94        &self.next_message_token
95    }
96    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
97        self._request_id = Some(request_id.into());
98        self
99    }
100
101    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
102        self._request_id = request_id;
103        self
104    }
105    /// Consumes the builder and constructs a [`SendMessageOutput`](crate::operation::send_message::SendMessageOutput).
106    /// This method will fail if any of the following fields are not set:
107    /// - [`request_message_id`](crate::operation::send_message::builders::SendMessageOutputBuilder::request_message_id)
108    /// - [`next_message_token`](crate::operation::send_message::builders::SendMessageOutputBuilder::next_message_token)
109    pub fn build(self) -> ::std::result::Result<crate::operation::send_message::SendMessageOutput, ::aws_smithy_types::error::operation::BuildError> {
110        ::std::result::Result::Ok(crate::operation::send_message::SendMessageOutput {
111            request_message_id: self.request_message_id.ok_or_else(|| {
112                ::aws_smithy_types::error::operation::BuildError::missing_field(
113                    "request_message_id",
114                    "request_message_id was not specified but it is required when building SendMessageOutput",
115                )
116            })?,
117            configuration: self.configuration,
118            next_message_token: self.next_message_token.ok_or_else(|| {
119                ::aws_smithy_types::error::operation::BuildError::missing_field(
120                    "next_message_token",
121                    "next_message_token was not specified but it is required when building SendMessageOutput",
122                )
123            })?,
124            _request_id: self._request_id,
125        })
126    }
127}