aws_sdk_pinpointsmsvoice/types/
_ssml_message_type.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// An object that defines a message that contains SSML-formatted text.
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct SsmlMessageType {
7    /// The language to use when delivering the message. For a complete list of supported languages, see the Amazon Polly Developer Guide.
8    pub language_code: ::std::option::Option<::std::string::String>,
9    /// The SSML-formatted text to deliver to the recipient.
10    pub text: ::std::option::Option<::std::string::String>,
11    /// The name of the voice that you want to use to deliver the message. For a complete list of supported voices, see the Amazon Polly Developer Guide.
12    pub voice_id: ::std::option::Option<::std::string::String>,
13}
14impl SsmlMessageType {
15    /// The language to use when delivering the message. For a complete list of supported languages, see the Amazon Polly Developer Guide.
16    pub fn language_code(&self) -> ::std::option::Option<&str> {
17        self.language_code.as_deref()
18    }
19    /// The SSML-formatted text to deliver to the recipient.
20    pub fn text(&self) -> ::std::option::Option<&str> {
21        self.text.as_deref()
22    }
23    /// The name of the voice that you want to use to deliver the message. For a complete list of supported voices, see the Amazon Polly Developer Guide.
24    pub fn voice_id(&self) -> ::std::option::Option<&str> {
25        self.voice_id.as_deref()
26    }
27}
28impl SsmlMessageType {
29    /// Creates a new builder-style object to manufacture [`SsmlMessageType`](crate::types::SsmlMessageType).
30    pub fn builder() -> crate::types::builders::SsmlMessageTypeBuilder {
31        crate::types::builders::SsmlMessageTypeBuilder::default()
32    }
33}
34
35/// A builder for [`SsmlMessageType`](crate::types::SsmlMessageType).
36#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
37#[non_exhaustive]
38pub struct SsmlMessageTypeBuilder {
39    pub(crate) language_code: ::std::option::Option<::std::string::String>,
40    pub(crate) text: ::std::option::Option<::std::string::String>,
41    pub(crate) voice_id: ::std::option::Option<::std::string::String>,
42}
43impl SsmlMessageTypeBuilder {
44    /// The language to use when delivering the message. For a complete list of supported languages, see the Amazon Polly Developer Guide.
45    pub fn language_code(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
46        self.language_code = ::std::option::Option::Some(input.into());
47        self
48    }
49    /// The language to use when delivering the message. For a complete list of supported languages, see the Amazon Polly Developer Guide.
50    pub fn set_language_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
51        self.language_code = input;
52        self
53    }
54    /// The language to use when delivering the message. For a complete list of supported languages, see the Amazon Polly Developer Guide.
55    pub fn get_language_code(&self) -> &::std::option::Option<::std::string::String> {
56        &self.language_code
57    }
58    /// The SSML-formatted text to deliver to the recipient.
59    pub fn text(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
60        self.text = ::std::option::Option::Some(input.into());
61        self
62    }
63    /// The SSML-formatted text to deliver to the recipient.
64    pub fn set_text(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
65        self.text = input;
66        self
67    }
68    /// The SSML-formatted text to deliver to the recipient.
69    pub fn get_text(&self) -> &::std::option::Option<::std::string::String> {
70        &self.text
71    }
72    /// The name of the voice that you want to use to deliver the message. For a complete list of supported voices, see the Amazon Polly Developer Guide.
73    pub fn voice_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
74        self.voice_id = ::std::option::Option::Some(input.into());
75        self
76    }
77    /// The name of the voice that you want to use to deliver the message. For a complete list of supported voices, see the Amazon Polly Developer Guide.
78    pub fn set_voice_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
79        self.voice_id = input;
80        self
81    }
82    /// The name of the voice that you want to use to deliver the message. For a complete list of supported voices, see the Amazon Polly Developer Guide.
83    pub fn get_voice_id(&self) -> &::std::option::Option<::std::string::String> {
84        &self.voice_id
85    }
86    /// Consumes the builder and constructs a [`SsmlMessageType`](crate::types::SsmlMessageType).
87    pub fn build(self) -> crate::types::SsmlMessageType {
88        crate::types::SsmlMessageType {
89            language_code: self.language_code,
90            text: self.text,
91            voice_id: self.voice_id,
92        }
93    }
94}