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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>In-app message configuration.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CampaignInAppMessage {
    /// <p>The message body of the notification, the email body or the text message.</p>
    pub body: ::std::option::Option<::std::string::String>,
    /// <p>In-app message content.</p>
    pub content: ::std::option::Option<::std::vec::Vec<crate::types::InAppMessageContent>>,
    /// <p>Custom config to be sent to client.</p>
    pub custom_config: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    /// <p>In-app message layout.</p>
    pub layout: ::std::option::Option<crate::types::Layout>,
}
impl CampaignInAppMessage {
    /// <p>The message body of the notification, the email body or the text message.</p>
    pub fn body(&self) -> ::std::option::Option<&str> {
        self.body.as_deref()
    }
    /// <p>In-app message content.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.content.is_none()`.
    pub fn content(&self) -> &[crate::types::InAppMessageContent] {
        self.content.as_deref().unwrap_or_default()
    }
    /// <p>Custom config to be sent to client.</p>
    pub fn custom_config(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.custom_config.as_ref()
    }
    /// <p>In-app message layout.</p>
    pub fn layout(&self) -> ::std::option::Option<&crate::types::Layout> {
        self.layout.as_ref()
    }
}
impl CampaignInAppMessage {
    /// Creates a new builder-style object to manufacture [`CampaignInAppMessage`](crate::types::CampaignInAppMessage).
    pub fn builder() -> crate::types::builders::CampaignInAppMessageBuilder {
        crate::types::builders::CampaignInAppMessageBuilder::default()
    }
}

/// A builder for [`CampaignInAppMessage`](crate::types::CampaignInAppMessage).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct CampaignInAppMessageBuilder {
    pub(crate) body: ::std::option::Option<::std::string::String>,
    pub(crate) content: ::std::option::Option<::std::vec::Vec<crate::types::InAppMessageContent>>,
    pub(crate) custom_config: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    pub(crate) layout: ::std::option::Option<crate::types::Layout>,
}
impl CampaignInAppMessageBuilder {
    /// <p>The message body of the notification, the email body or the text message.</p>
    pub fn body(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.body = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The message body of the notification, the email body or the text message.</p>
    pub fn set_body(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.body = input;
        self
    }
    /// <p>The message body of the notification, the email body or the text message.</p>
    pub fn get_body(&self) -> &::std::option::Option<::std::string::String> {
        &self.body
    }
    /// Appends an item to `content`.
    ///
    /// To override the contents of this collection use [`set_content`](Self::set_content).
    ///
    /// <p>In-app message content.</p>
    pub fn content(mut self, input: crate::types::InAppMessageContent) -> Self {
        let mut v = self.content.unwrap_or_default();
        v.push(input);
        self.content = ::std::option::Option::Some(v);
        self
    }
    /// <p>In-app message content.</p>
    pub fn set_content(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::InAppMessageContent>>) -> Self {
        self.content = input;
        self
    }
    /// <p>In-app message content.</p>
    pub fn get_content(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::InAppMessageContent>> {
        &self.content
    }
    /// Adds a key-value pair to `custom_config`.
    ///
    /// To override the contents of this collection use [`set_custom_config`](Self::set_custom_config).
    ///
    /// <p>Custom config to be sent to client.</p>
    pub fn custom_config(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut hash_map = self.custom_config.unwrap_or_default();
        hash_map.insert(k.into(), v.into());
        self.custom_config = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>Custom config to be sent to client.</p>
    pub fn set_custom_config(
        mut self,
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    ) -> Self {
        self.custom_config = input;
        self
    }
    /// <p>Custom config to be sent to client.</p>
    pub fn get_custom_config(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.custom_config
    }
    /// <p>In-app message layout.</p>
    pub fn layout(mut self, input: crate::types::Layout) -> Self {
        self.layout = ::std::option::Option::Some(input);
        self
    }
    /// <p>In-app message layout.</p>
    pub fn set_layout(mut self, input: ::std::option::Option<crate::types::Layout>) -> Self {
        self.layout = input;
        self
    }
    /// <p>In-app message layout.</p>
    pub fn get_layout(&self) -> &::std::option::Option<crate::types::Layout> {
        &self.layout
    }
    /// Consumes the builder and constructs a [`CampaignInAppMessage`](crate::types::CampaignInAppMessage).
    pub fn build(self) -> crate::types::CampaignInAppMessage {
        crate::types::CampaignInAppMessage {
            body: self.body,
            content: self.content,
            custom_config: self.custom_config,
            layout: self.layout,
        }
    }
}