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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Specifies the settings for a campaign treatment. A <i>treatment</i> is a variation of a campaign that's used for A/B testing of a campaign.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct WriteTreatmentResource {
    /// <p>The delivery configuration settings for sending the treatment through a custom channel. This object is required if the MessageConfiguration object for the treatment specifies a CustomMessage object.</p>
    pub custom_delivery_configuration: ::std::option::Option<crate::types::CustomDeliveryConfiguration>,
    /// <p>The message configuration settings for the treatment.</p>
    pub message_configuration: ::std::option::Option<crate::types::MessageConfiguration>,
    /// <p>The schedule settings for the treatment.</p>
    pub schedule: ::std::option::Option<crate::types::Schedule>,
    /// <p>The allocated percentage of users (segment members) to send the treatment to.</p>
    pub size_percent: ::std::option::Option<i32>,
    /// <p>The message template to use for the treatment.</p>
    pub template_configuration: ::std::option::Option<crate::types::TemplateConfiguration>,
    /// <p>A custom description of the treatment.</p>
    pub treatment_description: ::std::option::Option<::std::string::String>,
    /// <p>A custom name for the treatment.</p>
    pub treatment_name: ::std::option::Option<::std::string::String>,
}
impl WriteTreatmentResource {
    /// <p>The delivery configuration settings for sending the treatment through a custom channel. This object is required if the MessageConfiguration object for the treatment specifies a CustomMessage object.</p>
    pub fn custom_delivery_configuration(&self) -> ::std::option::Option<&crate::types::CustomDeliveryConfiguration> {
        self.custom_delivery_configuration.as_ref()
    }
    /// <p>The message configuration settings for the treatment.</p>
    pub fn message_configuration(&self) -> ::std::option::Option<&crate::types::MessageConfiguration> {
        self.message_configuration.as_ref()
    }
    /// <p>The schedule settings for the treatment.</p>
    pub fn schedule(&self) -> ::std::option::Option<&crate::types::Schedule> {
        self.schedule.as_ref()
    }
    /// <p>The allocated percentage of users (segment members) to send the treatment to.</p>
    pub fn size_percent(&self) -> ::std::option::Option<i32> {
        self.size_percent
    }
    /// <p>The message template to use for the treatment.</p>
    pub fn template_configuration(&self) -> ::std::option::Option<&crate::types::TemplateConfiguration> {
        self.template_configuration.as_ref()
    }
    /// <p>A custom description of the treatment.</p>
    pub fn treatment_description(&self) -> ::std::option::Option<&str> {
        self.treatment_description.as_deref()
    }
    /// <p>A custom name for the treatment.</p>
    pub fn treatment_name(&self) -> ::std::option::Option<&str> {
        self.treatment_name.as_deref()
    }
}
impl WriteTreatmentResource {
    /// Creates a new builder-style object to manufacture [`WriteTreatmentResource`](crate::types::WriteTreatmentResource).
    pub fn builder() -> crate::types::builders::WriteTreatmentResourceBuilder {
        crate::types::builders::WriteTreatmentResourceBuilder::default()
    }
}

/// A builder for [`WriteTreatmentResource`](crate::types::WriteTreatmentResource).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct WriteTreatmentResourceBuilder {
    pub(crate) custom_delivery_configuration: ::std::option::Option<crate::types::CustomDeliveryConfiguration>,
    pub(crate) message_configuration: ::std::option::Option<crate::types::MessageConfiguration>,
    pub(crate) schedule: ::std::option::Option<crate::types::Schedule>,
    pub(crate) size_percent: ::std::option::Option<i32>,
    pub(crate) template_configuration: ::std::option::Option<crate::types::TemplateConfiguration>,
    pub(crate) treatment_description: ::std::option::Option<::std::string::String>,
    pub(crate) treatment_name: ::std::option::Option<::std::string::String>,
}
impl WriteTreatmentResourceBuilder {
    /// <p>The delivery configuration settings for sending the treatment through a custom channel. This object is required if the MessageConfiguration object for the treatment specifies a CustomMessage object.</p>
    pub fn custom_delivery_configuration(mut self, input: crate::types::CustomDeliveryConfiguration) -> Self {
        self.custom_delivery_configuration = ::std::option::Option::Some(input);
        self
    }
    /// <p>The delivery configuration settings for sending the treatment through a custom channel. This object is required if the MessageConfiguration object for the treatment specifies a CustomMessage object.</p>
    pub fn set_custom_delivery_configuration(mut self, input: ::std::option::Option<crate::types::CustomDeliveryConfiguration>) -> Self {
        self.custom_delivery_configuration = input;
        self
    }
    /// <p>The delivery configuration settings for sending the treatment through a custom channel. This object is required if the MessageConfiguration object for the treatment specifies a CustomMessage object.</p>
    pub fn get_custom_delivery_configuration(&self) -> &::std::option::Option<crate::types::CustomDeliveryConfiguration> {
        &self.custom_delivery_configuration
    }
    /// <p>The message configuration settings for the treatment.</p>
    pub fn message_configuration(mut self, input: crate::types::MessageConfiguration) -> Self {
        self.message_configuration = ::std::option::Option::Some(input);
        self
    }
    /// <p>The message configuration settings for the treatment.</p>
    pub fn set_message_configuration(mut self, input: ::std::option::Option<crate::types::MessageConfiguration>) -> Self {
        self.message_configuration = input;
        self
    }
    /// <p>The message configuration settings for the treatment.</p>
    pub fn get_message_configuration(&self) -> &::std::option::Option<crate::types::MessageConfiguration> {
        &self.message_configuration
    }
    /// <p>The schedule settings for the treatment.</p>
    pub fn schedule(mut self, input: crate::types::Schedule) -> Self {
        self.schedule = ::std::option::Option::Some(input);
        self
    }
    /// <p>The schedule settings for the treatment.</p>
    pub fn set_schedule(mut self, input: ::std::option::Option<crate::types::Schedule>) -> Self {
        self.schedule = input;
        self
    }
    /// <p>The schedule settings for the treatment.</p>
    pub fn get_schedule(&self) -> &::std::option::Option<crate::types::Schedule> {
        &self.schedule
    }
    /// <p>The allocated percentage of users (segment members) to send the treatment to.</p>
    /// This field is required.
    pub fn size_percent(mut self, input: i32) -> Self {
        self.size_percent = ::std::option::Option::Some(input);
        self
    }
    /// <p>The allocated percentage of users (segment members) to send the treatment to.</p>
    pub fn set_size_percent(mut self, input: ::std::option::Option<i32>) -> Self {
        self.size_percent = input;
        self
    }
    /// <p>The allocated percentage of users (segment members) to send the treatment to.</p>
    pub fn get_size_percent(&self) -> &::std::option::Option<i32> {
        &self.size_percent
    }
    /// <p>The message template to use for the treatment.</p>
    pub fn template_configuration(mut self, input: crate::types::TemplateConfiguration) -> Self {
        self.template_configuration = ::std::option::Option::Some(input);
        self
    }
    /// <p>The message template to use for the treatment.</p>
    pub fn set_template_configuration(mut self, input: ::std::option::Option<crate::types::TemplateConfiguration>) -> Self {
        self.template_configuration = input;
        self
    }
    /// <p>The message template to use for the treatment.</p>
    pub fn get_template_configuration(&self) -> &::std::option::Option<crate::types::TemplateConfiguration> {
        &self.template_configuration
    }
    /// <p>A custom description of the treatment.</p>
    pub fn treatment_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.treatment_description = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A custom description of the treatment.</p>
    pub fn set_treatment_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.treatment_description = input;
        self
    }
    /// <p>A custom description of the treatment.</p>
    pub fn get_treatment_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.treatment_description
    }
    /// <p>A custom name for the treatment.</p>
    pub fn treatment_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.treatment_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A custom name for the treatment.</p>
    pub fn set_treatment_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.treatment_name = input;
        self
    }
    /// <p>A custom name for the treatment.</p>
    pub fn get_treatment_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.treatment_name
    }
    /// Consumes the builder and constructs a [`WriteTreatmentResource`](crate::types::WriteTreatmentResource).
    pub fn build(self) -> crate::types::WriteTreatmentResource {
        crate::types::WriteTreatmentResource {
            custom_delivery_configuration: self.custom_delivery_configuration,
            message_configuration: self.message_configuration,
            schedule: self.schedule,
            size_percent: self.size_percent,
            template_configuration: self.template_configuration,
            treatment_description: self.treatment_description,
            treatment_name: self.treatment_name,
        }
    }
}