#[non_exhaustive]pub struct Message {
pub platform: Platform,
pub message: Option<Message>,
/* private fields */
}answer-records or intents or participants or sessions only.Expand description
A rich response message.
Corresponds to the intent Response field in the Dialogflow console.
For more information, see
Rich response
messages.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.platform: PlatformOptional. The platform that this message is intended for.
message: Option<Message>Required. The rich response message.
Implementations§
Source§impl Message
impl Message
pub fn new() -> Self
Sourcepub fn set_platform<T: Into<Platform>>(self, v: T) -> Self
pub fn set_platform<T: Into<Platform>>(self, v: T) -> Self
Sourcepub fn set_message<T: Into<Option<Message>>>(self, v: T) -> Self
pub fn set_message<T: Into<Option<Message>>>(self, v: T) -> Self
Sets the value of message.
Note that all the setters affecting message are mutually
exclusive.
§Example
use google_cloud_dialogflow_v2::model::intent::message::Text;
let x = Message::new().set_message(Some(
google_cloud_dialogflow_v2::model::intent::message::Message::Text(Text::default().into())));Sourcepub fn text(&self) -> Option<&Box<Text>>
pub fn text(&self) -> Option<&Box<Text>>
The value of message
if it holds a Text, None if the field is not set or
holds a different branch.
Sourcepub fn set_text<T: Into<Box<Text>>>(self, v: T) -> Self
pub fn set_text<T: Into<Box<Text>>>(self, v: T) -> Self
Sets the value of message
to hold a Text.
Note that all the setters affecting message are
mutually exclusive.
§Example
use google_cloud_dialogflow_v2::model::intent::message::Text;
let x = Message::new().set_text(Text::default()/* use setters */);
assert!(x.text().is_some());
assert!(x.image().is_none());
assert!(x.quick_replies().is_none());
assert!(x.card().is_none());
assert!(x.payload().is_none());
assert!(x.simple_responses().is_none());
assert!(x.basic_card().is_none());
assert!(x.suggestions().is_none());
assert!(x.link_out_suggestion().is_none());
assert!(x.list_select().is_none());
assert!(x.carousel_select().is_none());
assert!(x.browse_carousel_card().is_none());
assert!(x.table_card().is_none());
assert!(x.media_content().is_none());Sourcepub fn image(&self) -> Option<&Box<Image>>
pub fn image(&self) -> Option<&Box<Image>>
The value of message
if it holds a Image, None if the field is not set or
holds a different branch.
Sourcepub fn set_image<T: Into<Box<Image>>>(self, v: T) -> Self
pub fn set_image<T: Into<Box<Image>>>(self, v: T) -> Self
Sets the value of message
to hold a Image.
Note that all the setters affecting message are
mutually exclusive.
§Example
use google_cloud_dialogflow_v2::model::intent::message::Image;
let x = Message::new().set_image(Image::default()/* use setters */);
assert!(x.image().is_some());
assert!(x.text().is_none());
assert!(x.quick_replies().is_none());
assert!(x.card().is_none());
assert!(x.payload().is_none());
assert!(x.simple_responses().is_none());
assert!(x.basic_card().is_none());
assert!(x.suggestions().is_none());
assert!(x.link_out_suggestion().is_none());
assert!(x.list_select().is_none());
assert!(x.carousel_select().is_none());
assert!(x.browse_carousel_card().is_none());
assert!(x.table_card().is_none());
assert!(x.media_content().is_none());Sourcepub fn quick_replies(&self) -> Option<&Box<QuickReplies>>
pub fn quick_replies(&self) -> Option<&Box<QuickReplies>>
The value of message
if it holds a QuickReplies, None if the field is not set or
holds a different branch.
Sourcepub fn set_quick_replies<T: Into<Box<QuickReplies>>>(self, v: T) -> Self
pub fn set_quick_replies<T: Into<Box<QuickReplies>>>(self, v: T) -> Self
Sets the value of message
to hold a QuickReplies.
Note that all the setters affecting message are
mutually exclusive.
§Example
use google_cloud_dialogflow_v2::model::intent::message::QuickReplies;
let x = Message::new().set_quick_replies(QuickReplies::default()/* use setters */);
assert!(x.quick_replies().is_some());
assert!(x.text().is_none());
assert!(x.image().is_none());
assert!(x.card().is_none());
assert!(x.payload().is_none());
assert!(x.simple_responses().is_none());
assert!(x.basic_card().is_none());
assert!(x.suggestions().is_none());
assert!(x.link_out_suggestion().is_none());
assert!(x.list_select().is_none());
assert!(x.carousel_select().is_none());
assert!(x.browse_carousel_card().is_none());
assert!(x.table_card().is_none());
assert!(x.media_content().is_none());Sourcepub fn card(&self) -> Option<&Box<Card>>
pub fn card(&self) -> Option<&Box<Card>>
The value of message
if it holds a Card, None if the field is not set or
holds a different branch.
Sourcepub fn set_card<T: Into<Box<Card>>>(self, v: T) -> Self
pub fn set_card<T: Into<Box<Card>>>(self, v: T) -> Self
Sets the value of message
to hold a Card.
Note that all the setters affecting message are
mutually exclusive.
§Example
use google_cloud_dialogflow_v2::model::intent::message::Card;
let x = Message::new().set_card(Card::default()/* use setters */);
assert!(x.card().is_some());
assert!(x.text().is_none());
assert!(x.image().is_none());
assert!(x.quick_replies().is_none());
assert!(x.payload().is_none());
assert!(x.simple_responses().is_none());
assert!(x.basic_card().is_none());
assert!(x.suggestions().is_none());
assert!(x.link_out_suggestion().is_none());
assert!(x.list_select().is_none());
assert!(x.carousel_select().is_none());
assert!(x.browse_carousel_card().is_none());
assert!(x.table_card().is_none());
assert!(x.media_content().is_none());Sourcepub fn payload(&self) -> Option<&Box<Struct>>
pub fn payload(&self) -> Option<&Box<Struct>>
The value of message
if it holds a Payload, None if the field is not set or
holds a different branch.
Sourcepub fn set_payload<T: Into<Box<Struct>>>(self, v: T) -> Self
pub fn set_payload<T: Into<Box<Struct>>>(self, v: T) -> Self
Sets the value of message
to hold a Payload.
Note that all the setters affecting message are
mutually exclusive.
§Example
use wkt::Struct;
let x = Message::new().set_payload(Struct::default()/* use setters */);
assert!(x.payload().is_some());
assert!(x.text().is_none());
assert!(x.image().is_none());
assert!(x.quick_replies().is_none());
assert!(x.card().is_none());
assert!(x.simple_responses().is_none());
assert!(x.basic_card().is_none());
assert!(x.suggestions().is_none());
assert!(x.link_out_suggestion().is_none());
assert!(x.list_select().is_none());
assert!(x.carousel_select().is_none());
assert!(x.browse_carousel_card().is_none());
assert!(x.table_card().is_none());
assert!(x.media_content().is_none());Sourcepub fn simple_responses(&self) -> Option<&Box<SimpleResponses>>
pub fn simple_responses(&self) -> Option<&Box<SimpleResponses>>
The value of message
if it holds a SimpleResponses, None if the field is not set or
holds a different branch.
Sourcepub fn set_simple_responses<T: Into<Box<SimpleResponses>>>(self, v: T) -> Self
pub fn set_simple_responses<T: Into<Box<SimpleResponses>>>(self, v: T) -> Self
Sets the value of message
to hold a SimpleResponses.
Note that all the setters affecting message are
mutually exclusive.
§Example
use google_cloud_dialogflow_v2::model::intent::message::SimpleResponses;
let x = Message::new().set_simple_responses(SimpleResponses::default()/* use setters */);
assert!(x.simple_responses().is_some());
assert!(x.text().is_none());
assert!(x.image().is_none());
assert!(x.quick_replies().is_none());
assert!(x.card().is_none());
assert!(x.payload().is_none());
assert!(x.basic_card().is_none());
assert!(x.suggestions().is_none());
assert!(x.link_out_suggestion().is_none());
assert!(x.list_select().is_none());
assert!(x.carousel_select().is_none());
assert!(x.browse_carousel_card().is_none());
assert!(x.table_card().is_none());
assert!(x.media_content().is_none());Sourcepub fn basic_card(&self) -> Option<&Box<BasicCard>>
pub fn basic_card(&self) -> Option<&Box<BasicCard>>
The value of message
if it holds a BasicCard, None if the field is not set or
holds a different branch.
Sourcepub fn set_basic_card<T: Into<Box<BasicCard>>>(self, v: T) -> Self
pub fn set_basic_card<T: Into<Box<BasicCard>>>(self, v: T) -> Self
Sets the value of message
to hold a BasicCard.
Note that all the setters affecting message are
mutually exclusive.
§Example
use google_cloud_dialogflow_v2::model::intent::message::BasicCard;
let x = Message::new().set_basic_card(BasicCard::default()/* use setters */);
assert!(x.basic_card().is_some());
assert!(x.text().is_none());
assert!(x.image().is_none());
assert!(x.quick_replies().is_none());
assert!(x.card().is_none());
assert!(x.payload().is_none());
assert!(x.simple_responses().is_none());
assert!(x.suggestions().is_none());
assert!(x.link_out_suggestion().is_none());
assert!(x.list_select().is_none());
assert!(x.carousel_select().is_none());
assert!(x.browse_carousel_card().is_none());
assert!(x.table_card().is_none());
assert!(x.media_content().is_none());Sourcepub fn suggestions(&self) -> Option<&Box<Suggestions>>
pub fn suggestions(&self) -> Option<&Box<Suggestions>>
The value of message
if it holds a Suggestions, None if the field is not set or
holds a different branch.
Sourcepub fn set_suggestions<T: Into<Box<Suggestions>>>(self, v: T) -> Self
pub fn set_suggestions<T: Into<Box<Suggestions>>>(self, v: T) -> Self
Sets the value of message
to hold a Suggestions.
Note that all the setters affecting message are
mutually exclusive.
§Example
use google_cloud_dialogflow_v2::model::intent::message::Suggestions;
let x = Message::new().set_suggestions(Suggestions::default()/* use setters */);
assert!(x.suggestions().is_some());
assert!(x.text().is_none());
assert!(x.image().is_none());
assert!(x.quick_replies().is_none());
assert!(x.card().is_none());
assert!(x.payload().is_none());
assert!(x.simple_responses().is_none());
assert!(x.basic_card().is_none());
assert!(x.link_out_suggestion().is_none());
assert!(x.list_select().is_none());
assert!(x.carousel_select().is_none());
assert!(x.browse_carousel_card().is_none());
assert!(x.table_card().is_none());
assert!(x.media_content().is_none());Sourcepub fn link_out_suggestion(&self) -> Option<&Box<LinkOutSuggestion>>
pub fn link_out_suggestion(&self) -> Option<&Box<LinkOutSuggestion>>
The value of message
if it holds a LinkOutSuggestion, None if the field is not set or
holds a different branch.
Sourcepub fn set_link_out_suggestion<T: Into<Box<LinkOutSuggestion>>>(
self,
v: T,
) -> Self
pub fn set_link_out_suggestion<T: Into<Box<LinkOutSuggestion>>>( self, v: T, ) -> Self
Sets the value of message
to hold a LinkOutSuggestion.
Note that all the setters affecting message are
mutually exclusive.
§Example
use google_cloud_dialogflow_v2::model::intent::message::LinkOutSuggestion;
let x = Message::new().set_link_out_suggestion(LinkOutSuggestion::default()/* use setters */);
assert!(x.link_out_suggestion().is_some());
assert!(x.text().is_none());
assert!(x.image().is_none());
assert!(x.quick_replies().is_none());
assert!(x.card().is_none());
assert!(x.payload().is_none());
assert!(x.simple_responses().is_none());
assert!(x.basic_card().is_none());
assert!(x.suggestions().is_none());
assert!(x.list_select().is_none());
assert!(x.carousel_select().is_none());
assert!(x.browse_carousel_card().is_none());
assert!(x.table_card().is_none());
assert!(x.media_content().is_none());Sourcepub fn list_select(&self) -> Option<&Box<ListSelect>>
pub fn list_select(&self) -> Option<&Box<ListSelect>>
The value of message
if it holds a ListSelect, None if the field is not set or
holds a different branch.
Sourcepub fn set_list_select<T: Into<Box<ListSelect>>>(self, v: T) -> Self
pub fn set_list_select<T: Into<Box<ListSelect>>>(self, v: T) -> Self
Sets the value of message
to hold a ListSelect.
Note that all the setters affecting message are
mutually exclusive.
§Example
use google_cloud_dialogflow_v2::model::intent::message::ListSelect;
let x = Message::new().set_list_select(ListSelect::default()/* use setters */);
assert!(x.list_select().is_some());
assert!(x.text().is_none());
assert!(x.image().is_none());
assert!(x.quick_replies().is_none());
assert!(x.card().is_none());
assert!(x.payload().is_none());
assert!(x.simple_responses().is_none());
assert!(x.basic_card().is_none());
assert!(x.suggestions().is_none());
assert!(x.link_out_suggestion().is_none());
assert!(x.carousel_select().is_none());
assert!(x.browse_carousel_card().is_none());
assert!(x.table_card().is_none());
assert!(x.media_content().is_none());Sourcepub fn carousel_select(&self) -> Option<&Box<CarouselSelect>>
pub fn carousel_select(&self) -> Option<&Box<CarouselSelect>>
The value of message
if it holds a CarouselSelect, None if the field is not set or
holds a different branch.
Sourcepub fn set_carousel_select<T: Into<Box<CarouselSelect>>>(self, v: T) -> Self
pub fn set_carousel_select<T: Into<Box<CarouselSelect>>>(self, v: T) -> Self
Sets the value of message
to hold a CarouselSelect.
Note that all the setters affecting message are
mutually exclusive.
§Example
use google_cloud_dialogflow_v2::model::intent::message::CarouselSelect;
let x = Message::new().set_carousel_select(CarouselSelect::default()/* use setters */);
assert!(x.carousel_select().is_some());
assert!(x.text().is_none());
assert!(x.image().is_none());
assert!(x.quick_replies().is_none());
assert!(x.card().is_none());
assert!(x.payload().is_none());
assert!(x.simple_responses().is_none());
assert!(x.basic_card().is_none());
assert!(x.suggestions().is_none());
assert!(x.link_out_suggestion().is_none());
assert!(x.list_select().is_none());
assert!(x.browse_carousel_card().is_none());
assert!(x.table_card().is_none());
assert!(x.media_content().is_none());Sourcepub fn browse_carousel_card(&self) -> Option<&Box<BrowseCarouselCard>>
pub fn browse_carousel_card(&self) -> Option<&Box<BrowseCarouselCard>>
The value of message
if it holds a BrowseCarouselCard, None if the field is not set or
holds a different branch.
Sourcepub fn set_browse_carousel_card<T: Into<Box<BrowseCarouselCard>>>(
self,
v: T,
) -> Self
pub fn set_browse_carousel_card<T: Into<Box<BrowseCarouselCard>>>( self, v: T, ) -> Self
Sets the value of message
to hold a BrowseCarouselCard.
Note that all the setters affecting message are
mutually exclusive.
§Example
use google_cloud_dialogflow_v2::model::intent::message::BrowseCarouselCard;
let x = Message::new().set_browse_carousel_card(BrowseCarouselCard::default()/* use setters */);
assert!(x.browse_carousel_card().is_some());
assert!(x.text().is_none());
assert!(x.image().is_none());
assert!(x.quick_replies().is_none());
assert!(x.card().is_none());
assert!(x.payload().is_none());
assert!(x.simple_responses().is_none());
assert!(x.basic_card().is_none());
assert!(x.suggestions().is_none());
assert!(x.link_out_suggestion().is_none());
assert!(x.list_select().is_none());
assert!(x.carousel_select().is_none());
assert!(x.table_card().is_none());
assert!(x.media_content().is_none());Sourcepub fn table_card(&self) -> Option<&Box<TableCard>>
pub fn table_card(&self) -> Option<&Box<TableCard>>
The value of message
if it holds a TableCard, None if the field is not set or
holds a different branch.
Sourcepub fn set_table_card<T: Into<Box<TableCard>>>(self, v: T) -> Self
pub fn set_table_card<T: Into<Box<TableCard>>>(self, v: T) -> Self
Sets the value of message
to hold a TableCard.
Note that all the setters affecting message are
mutually exclusive.
§Example
use google_cloud_dialogflow_v2::model::intent::message::TableCard;
let x = Message::new().set_table_card(TableCard::default()/* use setters */);
assert!(x.table_card().is_some());
assert!(x.text().is_none());
assert!(x.image().is_none());
assert!(x.quick_replies().is_none());
assert!(x.card().is_none());
assert!(x.payload().is_none());
assert!(x.simple_responses().is_none());
assert!(x.basic_card().is_none());
assert!(x.suggestions().is_none());
assert!(x.link_out_suggestion().is_none());
assert!(x.list_select().is_none());
assert!(x.carousel_select().is_none());
assert!(x.browse_carousel_card().is_none());
assert!(x.media_content().is_none());Sourcepub fn media_content(&self) -> Option<&Box<MediaContent>>
pub fn media_content(&self) -> Option<&Box<MediaContent>>
The value of message
if it holds a MediaContent, None if the field is not set or
holds a different branch.
Sourcepub fn set_media_content<T: Into<Box<MediaContent>>>(self, v: T) -> Self
pub fn set_media_content<T: Into<Box<MediaContent>>>(self, v: T) -> Self
Sets the value of message
to hold a MediaContent.
Note that all the setters affecting message are
mutually exclusive.
§Example
use google_cloud_dialogflow_v2::model::intent::message::MediaContent;
let x = Message::new().set_media_content(MediaContent::default()/* use setters */);
assert!(x.media_content().is_some());
assert!(x.text().is_none());
assert!(x.image().is_none());
assert!(x.quick_replies().is_none());
assert!(x.card().is_none());
assert!(x.payload().is_none());
assert!(x.simple_responses().is_none());
assert!(x.basic_card().is_none());
assert!(x.suggestions().is_none());
assert!(x.link_out_suggestion().is_none());
assert!(x.list_select().is_none());
assert!(x.carousel_select().is_none());
assert!(x.browse_carousel_card().is_none());
assert!(x.table_card().is_none());