aws_sdk_pinpoint/types/_voice_template_response.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Provides information about the content and settings for a message template that can be used in messages that are sent through the voice channel.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct VoiceTemplateResponse {
7 /// <p>The Amazon Resource Name (ARN) of the message template.</p>
8 pub arn: ::std::option::Option<::std::string::String>,
9 /// <p>The text of the script that's used in messages that are based on the message template, in plain text format.</p>
10 pub body: ::std::option::Option<::std::string::String>,
11 /// <p>The date, in ISO 8601 format, when the message template was created.</p>
12 pub creation_date: ::std::option::Option<::std::string::String>,
13 /// <p>The JSON object that specifies the default values that are used for message variables in the message template. This object is a set of key-value pairs. Each key defines a message variable in the template. The corresponding value defines the default value for that variable.</p>
14 pub default_substitutions: ::std::option::Option<::std::string::String>,
15 /// <p>The code for the language that's used when synthesizing the text of the script in messages that are based on the message template. For a list of supported languages and the code for each one, see the <a href="https://docs.aws.amazon.com/polly/latest/dg/what-is.html">Amazon Polly Developer Guide</a>.</p>
16 pub language_code: ::std::option::Option<::std::string::String>,
17 /// <p>The date, in ISO 8601 format, when the message template was last modified.</p>
18 pub last_modified_date: ::std::option::Option<::std::string::String>,
19 /// <p>A string-to-string map of key-value pairs that identifies the tags that are associated with the message template. Each tag consists of a required tag key and an associated tag value.</p>
20 pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
21 /// <p>The custom description of the message template.</p>
22 pub template_description: ::std::option::Option<::std::string::String>,
23 /// <p>The name of the message template.</p>
24 pub template_name: ::std::option::Option<::std::string::String>,
25 /// <p>The type of channel that the message template is designed for. For a voice template, this value is VOICE.</p>
26 pub template_type: ::std::option::Option<crate::types::TemplateType>,
27 /// <p>The unique identifier, as an integer, for the active version of the message template, or the version of the template that you specified by using the version parameter in your request.</p>
28 pub version: ::std::option::Option<::std::string::String>,
29 /// <p>The name of the voice that's used when delivering messages that are based on the message template. For a list of supported voices, see the <a href="https://docs.aws.amazon.com/polly/latest/dg/what-is.html">Amazon Polly Developer Guide</a>.</p>
30 pub voice_id: ::std::option::Option<::std::string::String>,
31}
32impl VoiceTemplateResponse {
33 /// <p>The Amazon Resource Name (ARN) of the message template.</p>
34 pub fn arn(&self) -> ::std::option::Option<&str> {
35 self.arn.as_deref()
36 }
37 /// <p>The text of the script that's used in messages that are based on the message template, in plain text format.</p>
38 pub fn body(&self) -> ::std::option::Option<&str> {
39 self.body.as_deref()
40 }
41 /// <p>The date, in ISO 8601 format, when the message template was created.</p>
42 pub fn creation_date(&self) -> ::std::option::Option<&str> {
43 self.creation_date.as_deref()
44 }
45 /// <p>The JSON object that specifies the default values that are used for message variables in the message template. This object is a set of key-value pairs. Each key defines a message variable in the template. The corresponding value defines the default value for that variable.</p>
46 pub fn default_substitutions(&self) -> ::std::option::Option<&str> {
47 self.default_substitutions.as_deref()
48 }
49 /// <p>The code for the language that's used when synthesizing the text of the script in messages that are based on the message template. For a list of supported languages and the code for each one, see the <a href="https://docs.aws.amazon.com/polly/latest/dg/what-is.html">Amazon Polly Developer Guide</a>.</p>
50 pub fn language_code(&self) -> ::std::option::Option<&str> {
51 self.language_code.as_deref()
52 }
53 /// <p>The date, in ISO 8601 format, when the message template was last modified.</p>
54 pub fn last_modified_date(&self) -> ::std::option::Option<&str> {
55 self.last_modified_date.as_deref()
56 }
57 /// <p>A string-to-string map of key-value pairs that identifies the tags that are associated with the message template. Each tag consists of a required tag key and an associated tag value.</p>
58 pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
59 self.tags.as_ref()
60 }
61 /// <p>The custom description of the message template.</p>
62 pub fn template_description(&self) -> ::std::option::Option<&str> {
63 self.template_description.as_deref()
64 }
65 /// <p>The name of the message template.</p>
66 pub fn template_name(&self) -> ::std::option::Option<&str> {
67 self.template_name.as_deref()
68 }
69 /// <p>The type of channel that the message template is designed for. For a voice template, this value is VOICE.</p>
70 pub fn template_type(&self) -> ::std::option::Option<&crate::types::TemplateType> {
71 self.template_type.as_ref()
72 }
73 /// <p>The unique identifier, as an integer, for the active version of the message template, or the version of the template that you specified by using the version parameter in your request.</p>
74 pub fn version(&self) -> ::std::option::Option<&str> {
75 self.version.as_deref()
76 }
77 /// <p>The name of the voice that's used when delivering messages that are based on the message template. For a list of supported voices, see the <a href="https://docs.aws.amazon.com/polly/latest/dg/what-is.html">Amazon Polly Developer Guide</a>.</p>
78 pub fn voice_id(&self) -> ::std::option::Option<&str> {
79 self.voice_id.as_deref()
80 }
81}
82impl VoiceTemplateResponse {
83 /// Creates a new builder-style object to manufacture [`VoiceTemplateResponse`](crate::types::VoiceTemplateResponse).
84 pub fn builder() -> crate::types::builders::VoiceTemplateResponseBuilder {
85 crate::types::builders::VoiceTemplateResponseBuilder::default()
86 }
87}
88
89/// A builder for [`VoiceTemplateResponse`](crate::types::VoiceTemplateResponse).
90#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
91#[non_exhaustive]
92pub struct VoiceTemplateResponseBuilder {
93 pub(crate) arn: ::std::option::Option<::std::string::String>,
94 pub(crate) body: ::std::option::Option<::std::string::String>,
95 pub(crate) creation_date: ::std::option::Option<::std::string::String>,
96 pub(crate) default_substitutions: ::std::option::Option<::std::string::String>,
97 pub(crate) language_code: ::std::option::Option<::std::string::String>,
98 pub(crate) last_modified_date: ::std::option::Option<::std::string::String>,
99 pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
100 pub(crate) template_description: ::std::option::Option<::std::string::String>,
101 pub(crate) template_name: ::std::option::Option<::std::string::String>,
102 pub(crate) template_type: ::std::option::Option<crate::types::TemplateType>,
103 pub(crate) version: ::std::option::Option<::std::string::String>,
104 pub(crate) voice_id: ::std::option::Option<::std::string::String>,
105}
106impl VoiceTemplateResponseBuilder {
107 /// <p>The Amazon Resource Name (ARN) of the message template.</p>
108 pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
109 self.arn = ::std::option::Option::Some(input.into());
110 self
111 }
112 /// <p>The Amazon Resource Name (ARN) of the message template.</p>
113 pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
114 self.arn = input;
115 self
116 }
117 /// <p>The Amazon Resource Name (ARN) of the message template.</p>
118 pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
119 &self.arn
120 }
121 /// <p>The text of the script that's used in messages that are based on the message template, in plain text format.</p>
122 pub fn body(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
123 self.body = ::std::option::Option::Some(input.into());
124 self
125 }
126 /// <p>The text of the script that's used in messages that are based on the message template, in plain text format.</p>
127 pub fn set_body(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
128 self.body = input;
129 self
130 }
131 /// <p>The text of the script that's used in messages that are based on the message template, in plain text format.</p>
132 pub fn get_body(&self) -> &::std::option::Option<::std::string::String> {
133 &self.body
134 }
135 /// <p>The date, in ISO 8601 format, when the message template was created.</p>
136 /// This field is required.
137 pub fn creation_date(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
138 self.creation_date = ::std::option::Option::Some(input.into());
139 self
140 }
141 /// <p>The date, in ISO 8601 format, when the message template was created.</p>
142 pub fn set_creation_date(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
143 self.creation_date = input;
144 self
145 }
146 /// <p>The date, in ISO 8601 format, when the message template was created.</p>
147 pub fn get_creation_date(&self) -> &::std::option::Option<::std::string::String> {
148 &self.creation_date
149 }
150 /// <p>The JSON object that specifies the default values that are used for message variables in the message template. This object is a set of key-value pairs. Each key defines a message variable in the template. The corresponding value defines the default value for that variable.</p>
151 pub fn default_substitutions(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
152 self.default_substitutions = ::std::option::Option::Some(input.into());
153 self
154 }
155 /// <p>The JSON object that specifies the default values that are used for message variables in the message template. This object is a set of key-value pairs. Each key defines a message variable in the template. The corresponding value defines the default value for that variable.</p>
156 pub fn set_default_substitutions(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
157 self.default_substitutions = input;
158 self
159 }
160 /// <p>The JSON object that specifies the default values that are used for message variables in the message template. This object is a set of key-value pairs. Each key defines a message variable in the template. The corresponding value defines the default value for that variable.</p>
161 pub fn get_default_substitutions(&self) -> &::std::option::Option<::std::string::String> {
162 &self.default_substitutions
163 }
164 /// <p>The code for the language that's used when synthesizing the text of the script in messages that are based on the message template. For a list of supported languages and the code for each one, see the <a href="https://docs.aws.amazon.com/polly/latest/dg/what-is.html">Amazon Polly Developer Guide</a>.</p>
165 pub fn language_code(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
166 self.language_code = ::std::option::Option::Some(input.into());
167 self
168 }
169 /// <p>The code for the language that's used when synthesizing the text of the script in messages that are based on the message template. For a list of supported languages and the code for each one, see the <a href="https://docs.aws.amazon.com/polly/latest/dg/what-is.html">Amazon Polly Developer Guide</a>.</p>
170 pub fn set_language_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
171 self.language_code = input;
172 self
173 }
174 /// <p>The code for the language that's used when synthesizing the text of the script in messages that are based on the message template. For a list of supported languages and the code for each one, see the <a href="https://docs.aws.amazon.com/polly/latest/dg/what-is.html">Amazon Polly Developer Guide</a>.</p>
175 pub fn get_language_code(&self) -> &::std::option::Option<::std::string::String> {
176 &self.language_code
177 }
178 /// <p>The date, in ISO 8601 format, when the message template was last modified.</p>
179 /// This field is required.
180 pub fn last_modified_date(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
181 self.last_modified_date = ::std::option::Option::Some(input.into());
182 self
183 }
184 /// <p>The date, in ISO 8601 format, when the message template was last modified.</p>
185 pub fn set_last_modified_date(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
186 self.last_modified_date = input;
187 self
188 }
189 /// <p>The date, in ISO 8601 format, when the message template was last modified.</p>
190 pub fn get_last_modified_date(&self) -> &::std::option::Option<::std::string::String> {
191 &self.last_modified_date
192 }
193 /// Adds a key-value pair to `tags`.
194 ///
195 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
196 ///
197 /// <p>A string-to-string map of key-value pairs that identifies the tags that are associated with the message template. Each tag consists of a required tag key and an associated tag value.</p>
198 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
199 let mut hash_map = self.tags.unwrap_or_default();
200 hash_map.insert(k.into(), v.into());
201 self.tags = ::std::option::Option::Some(hash_map);
202 self
203 }
204 /// <p>A string-to-string map of key-value pairs that identifies the tags that are associated with the message template. Each tag consists of a required tag key and an associated tag value.</p>
205 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
206 self.tags = input;
207 self
208 }
209 /// <p>A string-to-string map of key-value pairs that identifies the tags that are associated with the message template. Each tag consists of a required tag key and an associated tag value.</p>
210 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
211 &self.tags
212 }
213 /// <p>The custom description of the message template.</p>
214 pub fn template_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
215 self.template_description = ::std::option::Option::Some(input.into());
216 self
217 }
218 /// <p>The custom description of the message template.</p>
219 pub fn set_template_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
220 self.template_description = input;
221 self
222 }
223 /// <p>The custom description of the message template.</p>
224 pub fn get_template_description(&self) -> &::std::option::Option<::std::string::String> {
225 &self.template_description
226 }
227 /// <p>The name of the message template.</p>
228 /// This field is required.
229 pub fn template_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
230 self.template_name = ::std::option::Option::Some(input.into());
231 self
232 }
233 /// <p>The name of the message template.</p>
234 pub fn set_template_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
235 self.template_name = input;
236 self
237 }
238 /// <p>The name of the message template.</p>
239 pub fn get_template_name(&self) -> &::std::option::Option<::std::string::String> {
240 &self.template_name
241 }
242 /// <p>The type of channel that the message template is designed for. For a voice template, this value is VOICE.</p>
243 /// This field is required.
244 pub fn template_type(mut self, input: crate::types::TemplateType) -> Self {
245 self.template_type = ::std::option::Option::Some(input);
246 self
247 }
248 /// <p>The type of channel that the message template is designed for. For a voice template, this value is VOICE.</p>
249 pub fn set_template_type(mut self, input: ::std::option::Option<crate::types::TemplateType>) -> Self {
250 self.template_type = input;
251 self
252 }
253 /// <p>The type of channel that the message template is designed for. For a voice template, this value is VOICE.</p>
254 pub fn get_template_type(&self) -> &::std::option::Option<crate::types::TemplateType> {
255 &self.template_type
256 }
257 /// <p>The unique identifier, as an integer, for the active version of the message template, or the version of the template that you specified by using the version parameter in your request.</p>
258 pub fn version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
259 self.version = ::std::option::Option::Some(input.into());
260 self
261 }
262 /// <p>The unique identifier, as an integer, for the active version of the message template, or the version of the template that you specified by using the version parameter in your request.</p>
263 pub fn set_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
264 self.version = input;
265 self
266 }
267 /// <p>The unique identifier, as an integer, for the active version of the message template, or the version of the template that you specified by using the version parameter in your request.</p>
268 pub fn get_version(&self) -> &::std::option::Option<::std::string::String> {
269 &self.version
270 }
271 /// <p>The name of the voice that's used when delivering messages that are based on the message template. For a list of supported voices, see the <a href="https://docs.aws.amazon.com/polly/latest/dg/what-is.html">Amazon Polly Developer Guide</a>.</p>
272 pub fn voice_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
273 self.voice_id = ::std::option::Option::Some(input.into());
274 self
275 }
276 /// <p>The name of the voice that's used when delivering messages that are based on the message template. For a list of supported voices, see the <a href="https://docs.aws.amazon.com/polly/latest/dg/what-is.html">Amazon Polly Developer Guide</a>.</p>
277 pub fn set_voice_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
278 self.voice_id = input;
279 self
280 }
281 /// <p>The name of the voice that's used when delivering messages that are based on the message template. For a list of supported voices, see the <a href="https://docs.aws.amazon.com/polly/latest/dg/what-is.html">Amazon Polly Developer Guide</a>.</p>
282 pub fn get_voice_id(&self) -> &::std::option::Option<::std::string::String> {
283 &self.voice_id
284 }
285 /// Consumes the builder and constructs a [`VoiceTemplateResponse`](crate::types::VoiceTemplateResponse).
286 pub fn build(self) -> crate::types::VoiceTemplateResponse {
287 crate::types::VoiceTemplateResponse {
288 arn: self.arn,
289 body: self.body,
290 creation_date: self.creation_date,
291 default_substitutions: self.default_substitutions,
292 language_code: self.language_code,
293 last_modified_date: self.last_modified_date,
294 tags: self.tags,
295 template_description: self.template_description,
296 template_name: self.template_name,
297 template_type: self.template_type,
298 version: self.version,
299 voice_id: self.voice_id,
300 }
301 }
302}