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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Represents the message to be sent, composed of a subject and a body.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Message {
/// <p>The subject of the message: A short summary of the content, which appears in the recipient's inbox.</p>
pub subject: ::std::option::Option<crate::types::Content>,
/// <p>The message body.</p>
pub body: ::std::option::Option<crate::types::Body>,
}
impl Message {
/// <p>The subject of the message: A short summary of the content, which appears in the recipient's inbox.</p>
pub fn subject(&self) -> ::std::option::Option<&crate::types::Content> {
self.subject.as_ref()
}
/// <p>The message body.</p>
pub fn body(&self) -> ::std::option::Option<&crate::types::Body> {
self.body.as_ref()
}
}
impl Message {
/// Creates a new builder-style object to manufacture [`Message`](crate::types::Message).
pub fn builder() -> crate::types::builders::MessageBuilder {
crate::types::builders::MessageBuilder::default()
}
}
/// A builder for [`Message`](crate::types::Message).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct MessageBuilder {
pub(crate) subject: ::std::option::Option<crate::types::Content>,
pub(crate) body: ::std::option::Option<crate::types::Body>,
}
impl MessageBuilder {
/// <p>The subject of the message: A short summary of the content, which appears in the recipient's inbox.</p>
/// This field is required.
pub fn subject(mut self, input: crate::types::Content) -> Self {
self.subject = ::std::option::Option::Some(input);
self
}
/// <p>The subject of the message: A short summary of the content, which appears in the recipient's inbox.</p>
pub fn set_subject(mut self, input: ::std::option::Option<crate::types::Content>) -> Self {
self.subject = input;
self
}
/// <p>The subject of the message: A short summary of the content, which appears in the recipient's inbox.</p>
pub fn get_subject(&self) -> &::std::option::Option<crate::types::Content> {
&self.subject
}
/// <p>The message body.</p>
/// This field is required.
pub fn body(mut self, input: crate::types::Body) -> Self {
self.body = ::std::option::Option::Some(input);
self
}
/// <p>The message body.</p>
pub fn set_body(mut self, input: ::std::option::Option<crate::types::Body>) -> Self {
self.body = input;
self
}
/// <p>The message body.</p>
pub fn get_body(&self) -> &::std::option::Option<crate::types::Body> {
&self.body
}
/// Consumes the builder and constructs a [`Message`](crate::types::Message).
pub fn build(self) -> crate::types::Message {
crate::types::Message {
subject: self.subject,
body: self.body,
}
}
}