aws-sdk-lexmodelsv2 1.110.0

AWS SDK for Amazon Lex Model Building V2
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>The object that provides message text and its type.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Message {
    /// <p>A message in plain text format.</p>
    pub plain_text_message: ::std::option::Option<crate::types::PlainTextMessage>,
    /// <p>A message in a custom format defined by the client application.</p>
    pub custom_payload: ::std::option::Option<crate::types::CustomPayload>,
    /// <p>A message in Speech Synthesis Markup Language (SSML).</p>
    pub ssml_message: ::std::option::Option<crate::types::SsmlMessage>,
    /// <p>A message that defines a response card that the client application can show to the user.</p>
    pub image_response_card: ::std::option::Option<crate::types::ImageResponseCard>,
}
impl Message {
    /// <p>A message in plain text format.</p>
    pub fn plain_text_message(&self) -> ::std::option::Option<&crate::types::PlainTextMessage> {
        self.plain_text_message.as_ref()
    }
    /// <p>A message in a custom format defined by the client application.</p>
    pub fn custom_payload(&self) -> ::std::option::Option<&crate::types::CustomPayload> {
        self.custom_payload.as_ref()
    }
    /// <p>A message in Speech Synthesis Markup Language (SSML).</p>
    pub fn ssml_message(&self) -> ::std::option::Option<&crate::types::SsmlMessage> {
        self.ssml_message.as_ref()
    }
    /// <p>A message that defines a response card that the client application can show to the user.</p>
    pub fn image_response_card(&self) -> ::std::option::Option<&crate::types::ImageResponseCard> {
        self.image_response_card.as_ref()
    }
}
impl Message {
    /// Creates a new builder-style object to manufacture [`Message`](crate::types::Message).
    pub fn builder() -> crate::types::builders::MessageBuilder {
        crate::types::builders::MessageBuilder::default()
    }
}

/// A builder for [`Message`](crate::types::Message).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct MessageBuilder {
    pub(crate) plain_text_message: ::std::option::Option<crate::types::PlainTextMessage>,
    pub(crate) custom_payload: ::std::option::Option<crate::types::CustomPayload>,
    pub(crate) ssml_message: ::std::option::Option<crate::types::SsmlMessage>,
    pub(crate) image_response_card: ::std::option::Option<crate::types::ImageResponseCard>,
}
impl MessageBuilder {
    /// <p>A message in plain text format.</p>
    pub fn plain_text_message(mut self, input: crate::types::PlainTextMessage) -> Self {
        self.plain_text_message = ::std::option::Option::Some(input);
        self
    }
    /// <p>A message in plain text format.</p>
    pub fn set_plain_text_message(mut self, input: ::std::option::Option<crate::types::PlainTextMessage>) -> Self {
        self.plain_text_message = input;
        self
    }
    /// <p>A message in plain text format.</p>
    pub fn get_plain_text_message(&self) -> &::std::option::Option<crate::types::PlainTextMessage> {
        &self.plain_text_message
    }
    /// <p>A message in a custom format defined by the client application.</p>
    pub fn custom_payload(mut self, input: crate::types::CustomPayload) -> Self {
        self.custom_payload = ::std::option::Option::Some(input);
        self
    }
    /// <p>A message in a custom format defined by the client application.</p>
    pub fn set_custom_payload(mut self, input: ::std::option::Option<crate::types::CustomPayload>) -> Self {
        self.custom_payload = input;
        self
    }
    /// <p>A message in a custom format defined by the client application.</p>
    pub fn get_custom_payload(&self) -> &::std::option::Option<crate::types::CustomPayload> {
        &self.custom_payload
    }
    /// <p>A message in Speech Synthesis Markup Language (SSML).</p>
    pub fn ssml_message(mut self, input: crate::types::SsmlMessage) -> Self {
        self.ssml_message = ::std::option::Option::Some(input);
        self
    }
    /// <p>A message in Speech Synthesis Markup Language (SSML).</p>
    pub fn set_ssml_message(mut self, input: ::std::option::Option<crate::types::SsmlMessage>) -> Self {
        self.ssml_message = input;
        self
    }
    /// <p>A message in Speech Synthesis Markup Language (SSML).</p>
    pub fn get_ssml_message(&self) -> &::std::option::Option<crate::types::SsmlMessage> {
        &self.ssml_message
    }
    /// <p>A message that defines a response card that the client application can show to the user.</p>
    pub fn image_response_card(mut self, input: crate::types::ImageResponseCard) -> Self {
        self.image_response_card = ::std::option::Option::Some(input);
        self
    }
    /// <p>A message that defines a response card that the client application can show to the user.</p>
    pub fn set_image_response_card(mut self, input: ::std::option::Option<crate::types::ImageResponseCard>) -> Self {
        self.image_response_card = input;
        self
    }
    /// <p>A message that defines a response card that the client application can show to the user.</p>
    pub fn get_image_response_card(&self) -> &::std::option::Option<crate::types::ImageResponseCard> {
        &self.image_response_card
    }
    /// Consumes the builder and constructs a [`Message`](crate::types::Message).
    pub fn build(self) -> crate::types::Message {
        crate::types::Message {
            plain_text_message: self.plain_text_message,
            custom_payload: self.custom_payload,
            ssml_message: self.ssml_message,
            image_response_card: self.image_response_card,
        }
    }
}