Copyright | (c) Mauricio Fierro 2019 |
---|---|
License | BSD3-Clause |
Maintainer | Mauricio Fierro <mauriciofierrom@gmail.com> |
Safe Haskell | None |
Language | Haskell2010 |
This module contains types for Dialogflow messages to be used in a fulfillment webhook response. See the Dialogflow documentation.
Synopsis
- data CardButton = CardButton {}
- data BasicCardContent
- data BasicCardButton = BasicCardButton {}
- data Item = Item {
- iInfo :: SelectItemInfo
- iTitle :: String
- iDescription :: Maybe String
- iImage :: Msg MsgImage
- newtype OpenUriAction = OpenUriAction {}
- data SpeechText
- data SimpleResponse = SimpleResponse {}
- newtype Suggestion = Suggestion {}
- data SelectItemInfo = SelectItemInfo {
- siiKey :: String
- siiSynonyms :: Maybe [String]
- data MsgType
- data Msg t where
- Text :: Maybe [String] -> Msg MsgText
- Image :: String -> Maybe String -> Msg MsgImage
- QuickReplies :: Maybe String -> [String] -> Msg MsgQuickReplies
- Card :: Maybe String -> Maybe String -> Maybe String -> Maybe [CardButton] -> Msg MsgCard
- SimpleResponses :: [SimpleResponse] -> Msg MsgSimpleResponses
- BasicCard :: Maybe String -> Maybe String -> BasicCardContent -> Maybe [BasicCardButton] -> Msg MsgBasicCard
- Suggestions :: [Suggestion] -> Msg MsgSuggestions
- LinkOutSuggestion :: String -> String -> Msg MsgLinkOutSuggestion
- ListSelect :: Maybe String -> [Item] -> Msg MsgListSelect
- CarouselSelect :: [Item] -> Msg MsgCarouselSelect
- data Message where
Documentation
data CardButton Source #
Button for a Card
message
Instances
Eq CardButton Source # | |
Defined in Dialogflow.V2.Fulfillment.Message (==) :: CardButton -> CardButton -> Bool # (/=) :: CardButton -> CardButton -> Bool # | |
Show CardButton Source # | |
Defined in Dialogflow.V2.Fulfillment.Message showsPrec :: Int -> CardButton -> ShowS # show :: CardButton -> String # showList :: [CardButton] -> ShowS # | |
ToJSON CardButton Source # | |
Defined in Dialogflow.V2.Fulfillment.Message toJSON :: CardButton -> Value # toEncoding :: CardButton -> Encoding # toJSONList :: [CardButton] -> Value # toEncodingList :: [CardButton] -> Encoding # | |
FromJSON CardButton Source # | |
Defined in Dialogflow.V2.Fulfillment.Message parseJSON :: Value -> Parser CardButton # parseJSONList :: Value -> Parser [CardButton] # |
data BasicCardContent Source #
Instances
Eq BasicCardContent Source # | |
Defined in Dialogflow.V2.Fulfillment.Message (==) :: BasicCardContent -> BasicCardContent -> Bool # (/=) :: BasicCardContent -> BasicCardContent -> Bool # | |
Show BasicCardContent Source # | |
Defined in Dialogflow.V2.Fulfillment.Message showsPrec :: Int -> BasicCardContent -> ShowS # show :: BasicCardContent -> String # showList :: [BasicCardContent] -> ShowS # | |
ToJSON BasicCardContent Source # | |
Defined in Dialogflow.V2.Fulfillment.Message toJSON :: BasicCardContent -> Value # toEncoding :: BasicCardContent -> Encoding # toJSONList :: [BasicCardContent] -> Value # toEncodingList :: [BasicCardContent] -> Encoding # | |
FromJSON BasicCardContent Source # | |
Defined in Dialogflow.V2.Fulfillment.Message parseJSON :: Value -> Parser BasicCardContent # parseJSONList :: Value -> Parser [BasicCardContent] # |
data BasicCardButton Source #
Buttons for BasicCard
s.
BasicCardButton | |
|
Instances
Eq BasicCardButton Source # | |
Defined in Dialogflow.V2.Fulfillment.Message (==) :: BasicCardButton -> BasicCardButton -> Bool # (/=) :: BasicCardButton -> BasicCardButton -> Bool # | |
Show BasicCardButton Source # | |
Defined in Dialogflow.V2.Fulfillment.Message showsPrec :: Int -> BasicCardButton -> ShowS # show :: BasicCardButton -> String # showList :: [BasicCardButton] -> ShowS # | |
ToJSON BasicCardButton Source # | |
Defined in Dialogflow.V2.Fulfillment.Message toJSON :: BasicCardButton -> Value # toEncoding :: BasicCardButton -> Encoding # toJSONList :: [BasicCardButton] -> Value # toEncodingList :: [BasicCardButton] -> Encoding # | |
FromJSON BasicCardButton Source # | |
Defined in Dialogflow.V2.Fulfillment.Message parseJSON :: Value -> Parser BasicCardButton # parseJSONList :: Value -> Parser [BasicCardButton] # |
An item in ListSelect
and CarouselSelect
.
Item | |
|
newtype OpenUriAction Source #
An action to open the given URI. Used in BasicCardButton
s.
OpenUriAction | |
|
Instances
Eq OpenUriAction Source # | |
Defined in Dialogflow.V2.Fulfillment.Message (==) :: OpenUriAction -> OpenUriAction -> Bool # (/=) :: OpenUriAction -> OpenUriAction -> Bool # | |
Show OpenUriAction Source # | |
Defined in Dialogflow.V2.Fulfillment.Message showsPrec :: Int -> OpenUriAction -> ShowS # show :: OpenUriAction -> String # showList :: [OpenUriAction] -> ShowS # | |
ToJSON OpenUriAction Source # | |
Defined in Dialogflow.V2.Fulfillment.Message toJSON :: OpenUriAction -> Value # toEncoding :: OpenUriAction -> Encoding # toJSONList :: [OpenUriAction] -> Value # toEncodingList :: [OpenUriAction] -> Encoding # | |
FromJSON OpenUriAction Source # | |
Defined in Dialogflow.V2.Fulfillment.Message parseJSON :: Value -> Parser OpenUriAction # parseJSONList :: Value -> Parser [OpenUriAction] # |
data SpeechText Source #
A SimpleResponse
can have text-to-speech in plain text
or SSML format.
TextToSpeech String | The plain text of the speech output |
SSML String | Structured spoken response to the user in SSML format |
Instances
Eq SpeechText Source # | |
Defined in Dialogflow.V2.Fulfillment.Message (==) :: SpeechText -> SpeechText -> Bool # (/=) :: SpeechText -> SpeechText -> Bool # | |
Show SpeechText Source # | |
Defined in Dialogflow.V2.Fulfillment.Message showsPrec :: Int -> SpeechText -> ShowS # show :: SpeechText -> String # showList :: [SpeechText] -> ShowS # | |
ToJSON SpeechText Source # | |
Defined in Dialogflow.V2.Fulfillment.Message toJSON :: SpeechText -> Value # toEncoding :: SpeechText -> Encoding # toJSONList :: [SpeechText] -> Value # toEncodingList :: [SpeechText] -> Encoding # | |
FromJSON SpeechText Source # | |
Defined in Dialogflow.V2.Fulfillment.Message parseJSON :: Value -> Parser SpeechText # parseJSONList :: Value -> Parser [SpeechText] # |
data SimpleResponse Source #
A simple response message containing speech or text
SimpleResponse | |
|
Instances
Eq SimpleResponse Source # | |
Defined in Dialogflow.V2.Fulfillment.Message (==) :: SimpleResponse -> SimpleResponse -> Bool # (/=) :: SimpleResponse -> SimpleResponse -> Bool # | |
Show SimpleResponse Source # | |
Defined in Dialogflow.V2.Fulfillment.Message showsPrec :: Int -> SimpleResponse -> ShowS # show :: SimpleResponse -> String # showList :: [SimpleResponse] -> ShowS # | |
ToJSON SimpleResponse Source # | |
Defined in Dialogflow.V2.Fulfillment.Message toJSON :: SimpleResponse -> Value # toEncoding :: SimpleResponse -> Encoding # toJSONList :: [SimpleResponse] -> Value # toEncodingList :: [SimpleResponse] -> Encoding # | |
FromJSON SimpleResponse Source # | |
Defined in Dialogflow.V2.Fulfillment.Message parseJSON :: Value -> Parser SimpleResponse # parseJSONList :: Value -> Parser [SimpleResponse] # |
newtype Suggestion Source #
Suggestion chips.
Suggestion | |
|
Instances
Eq Suggestion Source # | |
Defined in Dialogflow.V2.Fulfillment.Message (==) :: Suggestion -> Suggestion -> Bool # (/=) :: Suggestion -> Suggestion -> Bool # | |
Show Suggestion Source # | |
Defined in Dialogflow.V2.Fulfillment.Message showsPrec :: Int -> Suggestion -> ShowS # show :: Suggestion -> String # showList :: [Suggestion] -> ShowS # | |
ToJSON Suggestion Source # | |
Defined in Dialogflow.V2.Fulfillment.Message toJSON :: Suggestion -> Value # toEncoding :: Suggestion -> Encoding # toJSONList :: [Suggestion] -> Value # toEncodingList :: [Suggestion] -> Encoding # | |
FromJSON Suggestion Source # | |
Defined in Dialogflow.V2.Fulfillment.Message parseJSON :: Value -> Parser Suggestion # parseJSONList :: Value -> Parser [Suggestion] # |
data SelectItemInfo Source #
Additional information about an Item
for when it is triggered in a dialog.
SelectItemInfo | |
|
Instances
Eq SelectItemInfo Source # | |
Defined in Dialogflow.V2.Fulfillment.Message (==) :: SelectItemInfo -> SelectItemInfo -> Bool # (/=) :: SelectItemInfo -> SelectItemInfo -> Bool # | |
Show SelectItemInfo Source # | |
Defined in Dialogflow.V2.Fulfillment.Message showsPrec :: Int -> SelectItemInfo -> ShowS # show :: SelectItemInfo -> String # showList :: [SelectItemInfo] -> ShowS # | |
ToJSON SelectItemInfo Source # | |
Defined in Dialogflow.V2.Fulfillment.Message toJSON :: SelectItemInfo -> Value # toEncoding :: SelectItemInfo -> Encoding # toJSONList :: [SelectItemInfo] -> Value # toEncodingList :: [SelectItemInfo] -> Encoding # | |
FromJSON SelectItemInfo Source # | |
Defined in Dialogflow.V2.Fulfillment.Message parseJSON :: Value -> Parser SelectItemInfo # parseJSONList :: Value -> Parser [SelectItemInfo] # |
The possible types of Message
.
The messages to be included in the Response.
Text | The text response message. |
Image | The image response message. |
QuickReplies | The quick replies response message. |
| |
Card | The card response. |
SimpleResponses | The collection of |
| |
BasicCard | The basic card message. Useful for displaying information. |
| |
Suggestions | The collection of |
| |
LinkOutSuggestion | The suggestion chip message that allows the user to jump out to the app or the website associated with this agent. |
| |
ListSelect | The card for presenting a list of options to select from. |
| |
CarouselSelect | The card for representing a carousel of options to select from. |
|