module Network.AWS.LexRuntime.Types.Product where
import Network.AWS.Lens
import Network.AWS.LexRuntime.Types.Sum
import Network.AWS.Prelude
data Button = Button'
{ _bText :: !Text
, _bValue :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
button
:: Text
-> Text
-> Button
button pText_ pValue_ = Button' {_bText = pText_, _bValue = pValue_}
bText :: Lens' Button Text
bText = lens _bText (\ s a -> s{_bText = a});
bValue :: Lens' Button Text
bValue = lens _bValue (\ s a -> s{_bValue = a});
instance FromJSON Button where
parseJSON
= withObject "Button"
(\ x -> Button' <$> (x .: "text") <*> (x .: "value"))
instance Hashable Button where
instance NFData Button where
data GenericAttachment = GenericAttachment'
{ _gaButtons :: !(Maybe [Button])
, _gaSubTitle :: !(Maybe Text)
, _gaImageURL :: !(Maybe Text)
, _gaAttachmentLinkURL :: !(Maybe Text)
, _gaTitle :: !(Maybe Text)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
genericAttachment
:: GenericAttachment
genericAttachment =
GenericAttachment'
{ _gaButtons = Nothing
, _gaSubTitle = Nothing
, _gaImageURL = Nothing
, _gaAttachmentLinkURL = Nothing
, _gaTitle = Nothing
}
gaButtons :: Lens' GenericAttachment [Button]
gaButtons = lens _gaButtons (\ s a -> s{_gaButtons = a}) . _Default . _Coerce;
gaSubTitle :: Lens' GenericAttachment (Maybe Text)
gaSubTitle = lens _gaSubTitle (\ s a -> s{_gaSubTitle = a});
gaImageURL :: Lens' GenericAttachment (Maybe Text)
gaImageURL = lens _gaImageURL (\ s a -> s{_gaImageURL = a});
gaAttachmentLinkURL :: Lens' GenericAttachment (Maybe Text)
gaAttachmentLinkURL = lens _gaAttachmentLinkURL (\ s a -> s{_gaAttachmentLinkURL = a});
gaTitle :: Lens' GenericAttachment (Maybe Text)
gaTitle = lens _gaTitle (\ s a -> s{_gaTitle = a});
instance FromJSON GenericAttachment where
parseJSON
= withObject "GenericAttachment"
(\ x ->
GenericAttachment' <$>
(x .:? "buttons" .!= mempty) <*> (x .:? "subTitle")
<*> (x .:? "imageUrl")
<*> (x .:? "attachmentLinkUrl")
<*> (x .:? "title"))
instance Hashable GenericAttachment where
instance NFData GenericAttachment where
data ResponseCard = ResponseCard'
{ _rcGenericAttachments :: !(Maybe [GenericAttachment])
, _rcVersion :: !(Maybe Text)
, _rcContentType :: !(Maybe ContentType)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
responseCard
:: ResponseCard
responseCard =
ResponseCard'
{ _rcGenericAttachments = Nothing
, _rcVersion = Nothing
, _rcContentType = Nothing
}
rcGenericAttachments :: Lens' ResponseCard [GenericAttachment]
rcGenericAttachments = lens _rcGenericAttachments (\ s a -> s{_rcGenericAttachments = a}) . _Default . _Coerce;
rcVersion :: Lens' ResponseCard (Maybe Text)
rcVersion = lens _rcVersion (\ s a -> s{_rcVersion = a});
rcContentType :: Lens' ResponseCard (Maybe ContentType)
rcContentType = lens _rcContentType (\ s a -> s{_rcContentType = a});
instance FromJSON ResponseCard where
parseJSON
= withObject "ResponseCard"
(\ x ->
ResponseCard' <$>
(x .:? "genericAttachments" .!= mempty) <*>
(x .:? "version")
<*> (x .:? "contentType"))
instance Hashable ResponseCard where
instance NFData ResponseCard where