#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct Message {
pub content: ::std::option::Option<::std::string::String>,
pub content_type: crate::types::MessageContentType,
pub image_response_card: ::std::option::Option<crate::types::ImageResponseCard>,
}
impl Message {
pub fn content(&self) -> ::std::option::Option<&str> {
self.content.as_deref()
}
pub fn content_type(&self) -> &crate::types::MessageContentType {
&self.content_type
}
pub fn image_response_card(&self) -> ::std::option::Option<&crate::types::ImageResponseCard> {
self.image_response_card.as_ref()
}
}
impl ::std::fmt::Debug for Message {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("Message");
formatter.field("content", &"*** Sensitive Data Redacted ***");
formatter.field("content_type", &self.content_type);
formatter.field("image_response_card", &self.image_response_card);
formatter.finish()
}
}
impl Message {
pub fn builder() -> crate::types::builders::MessageBuilder {
crate::types::builders::MessageBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct MessageBuilder {
pub(crate) content: ::std::option::Option<::std::string::String>,
pub(crate) content_type: ::std::option::Option<crate::types::MessageContentType>,
pub(crate) image_response_card: ::std::option::Option<crate::types::ImageResponseCard>,
}
impl MessageBuilder {
pub fn content(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.content = ::std::option::Option::Some(input.into());
self
}
pub fn set_content(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.content = input;
self
}
pub fn get_content(&self) -> &::std::option::Option<::std::string::String> {
&self.content
}
pub fn content_type(mut self, input: crate::types::MessageContentType) -> Self {
self.content_type = ::std::option::Option::Some(input);
self
}
pub fn set_content_type(mut self, input: ::std::option::Option<crate::types::MessageContentType>) -> Self {
self.content_type = input;
self
}
pub fn get_content_type(&self) -> &::std::option::Option<crate::types::MessageContentType> {
&self.content_type
}
pub fn image_response_card(mut self, input: crate::types::ImageResponseCard) -> Self {
self.image_response_card = ::std::option::Option::Some(input);
self
}
pub fn set_image_response_card(mut self, input: ::std::option::Option<crate::types::ImageResponseCard>) -> Self {
self.image_response_card = input;
self
}
pub fn get_image_response_card(&self) -> &::std::option::Option<crate::types::ImageResponseCard> {
&self.image_response_card
}
pub fn build(self) -> ::std::result::Result<crate::types::Message, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::Message {
content: self.content,
content_type: self.content_type.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"content_type",
"content_type was not specified but it is required when building Message",
)
})?,
image_response_card: self.image_response_card,
})
}
}
impl ::std::fmt::Debug for MessageBuilder {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("MessageBuilder");
formatter.field("content", &"*** Sensitive Data Redacted ***");
formatter.field("content_type", &self.content_type);
formatter.field("image_response_card", &self.image_response_card);
formatter.finish()
}
}