{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.AWS.LexModels.Types.Product where
import Network.AWS.Lens
import Network.AWS.LexModels.Types.Sum
import Network.AWS.Prelude
data BotAliasMetadata = BotAliasMetadata'
{ _bamChecksum :: !(Maybe Text)
, _bamBotVersion :: !(Maybe Text)
, _bamBotName :: !(Maybe Text)
, _bamCreatedDate :: !(Maybe POSIX)
, _bamName :: !(Maybe Text)
, _bamLastUpdatedDate :: !(Maybe POSIX)
, _bamDescription :: !(Maybe Text)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
botAliasMetadata
:: BotAliasMetadata
botAliasMetadata =
BotAliasMetadata'
{ _bamChecksum = Nothing
, _bamBotVersion = Nothing
, _bamBotName = Nothing
, _bamCreatedDate = Nothing
, _bamName = Nothing
, _bamLastUpdatedDate = Nothing
, _bamDescription = Nothing
}
bamChecksum :: Lens' BotAliasMetadata (Maybe Text)
bamChecksum = lens _bamChecksum (\ s a -> s{_bamChecksum = a})
bamBotVersion :: Lens' BotAliasMetadata (Maybe Text)
bamBotVersion = lens _bamBotVersion (\ s a -> s{_bamBotVersion = a})
bamBotName :: Lens' BotAliasMetadata (Maybe Text)
bamBotName = lens _bamBotName (\ s a -> s{_bamBotName = a})
bamCreatedDate :: Lens' BotAliasMetadata (Maybe UTCTime)
bamCreatedDate = lens _bamCreatedDate (\ s a -> s{_bamCreatedDate = a}) . mapping _Time
bamName :: Lens' BotAliasMetadata (Maybe Text)
bamName = lens _bamName (\ s a -> s{_bamName = a})
bamLastUpdatedDate :: Lens' BotAliasMetadata (Maybe UTCTime)
bamLastUpdatedDate = lens _bamLastUpdatedDate (\ s a -> s{_bamLastUpdatedDate = a}) . mapping _Time
bamDescription :: Lens' BotAliasMetadata (Maybe Text)
bamDescription = lens _bamDescription (\ s a -> s{_bamDescription = a})
instance FromJSON BotAliasMetadata where
parseJSON
= withObject "BotAliasMetadata"
(\ x ->
BotAliasMetadata' <$>
(x .:? "checksum") <*> (x .:? "botVersion") <*>
(x .:? "botName")
<*> (x .:? "createdDate")
<*> (x .:? "name")
<*> (x .:? "lastUpdatedDate")
<*> (x .:? "description"))
instance Hashable BotAliasMetadata where
instance NFData BotAliasMetadata where
data BotChannelAssociation = BotChannelAssociation'
{ _bcaFailureReason :: !(Maybe Text)
, _bcaStatus :: !(Maybe ChannelStatus)
, _bcaBotAlias :: !(Maybe Text)
, _bcaBotName :: !(Maybe Text)
, _bcaBotConfiguration :: !(Maybe (Sensitive (Map Text Text)))
, _bcaCreatedDate :: !(Maybe POSIX)
, _bcaName :: !(Maybe Text)
, _bcaType :: !(Maybe ChannelType)
, _bcaDescription :: !(Maybe Text)
} deriving (Eq, Show, Data, Typeable, Generic)
botChannelAssociation
:: BotChannelAssociation
botChannelAssociation =
BotChannelAssociation'
{ _bcaFailureReason = Nothing
, _bcaStatus = Nothing
, _bcaBotAlias = Nothing
, _bcaBotName = Nothing
, _bcaBotConfiguration = Nothing
, _bcaCreatedDate = Nothing
, _bcaName = Nothing
, _bcaType = Nothing
, _bcaDescription = Nothing
}
bcaFailureReason :: Lens' BotChannelAssociation (Maybe Text)
bcaFailureReason = lens _bcaFailureReason (\ s a -> s{_bcaFailureReason = a})
bcaStatus :: Lens' BotChannelAssociation (Maybe ChannelStatus)
bcaStatus = lens _bcaStatus (\ s a -> s{_bcaStatus = a})
bcaBotAlias :: Lens' BotChannelAssociation (Maybe Text)
bcaBotAlias = lens _bcaBotAlias (\ s a -> s{_bcaBotAlias = a})
bcaBotName :: Lens' BotChannelAssociation (Maybe Text)
bcaBotName = lens _bcaBotName (\ s a -> s{_bcaBotName = a})
bcaBotConfiguration :: Lens' BotChannelAssociation (Maybe (HashMap Text Text))
bcaBotConfiguration = lens _bcaBotConfiguration (\ s a -> s{_bcaBotConfiguration = a}) . mapping (_Sensitive . _Map)
bcaCreatedDate :: Lens' BotChannelAssociation (Maybe UTCTime)
bcaCreatedDate = lens _bcaCreatedDate (\ s a -> s{_bcaCreatedDate = a}) . mapping _Time
bcaName :: Lens' BotChannelAssociation (Maybe Text)
bcaName = lens _bcaName (\ s a -> s{_bcaName = a})
bcaType :: Lens' BotChannelAssociation (Maybe ChannelType)
bcaType = lens _bcaType (\ s a -> s{_bcaType = a})
bcaDescription :: Lens' BotChannelAssociation (Maybe Text)
bcaDescription = lens _bcaDescription (\ s a -> s{_bcaDescription = a})
instance FromJSON BotChannelAssociation where
parseJSON
= withObject "BotChannelAssociation"
(\ x ->
BotChannelAssociation' <$>
(x .:? "failureReason") <*> (x .:? "status") <*>
(x .:? "botAlias")
<*> (x .:? "botName")
<*> (x .:? "botConfiguration" .!= mempty)
<*> (x .:? "createdDate")
<*> (x .:? "name")
<*> (x .:? "type")
<*> (x .:? "description"))
instance Hashable BotChannelAssociation where
instance NFData BotChannelAssociation where
data BotMetadata = BotMetadata'
{ _bmStatus :: !(Maybe LexStatus)
, _bmCreatedDate :: !(Maybe POSIX)
, _bmName :: !(Maybe Text)
, _bmVersion :: !(Maybe Text)
, _bmLastUpdatedDate :: !(Maybe POSIX)
, _bmDescription :: !(Maybe Text)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
botMetadata
:: BotMetadata
botMetadata =
BotMetadata'
{ _bmStatus = Nothing
, _bmCreatedDate = Nothing
, _bmName = Nothing
, _bmVersion = Nothing
, _bmLastUpdatedDate = Nothing
, _bmDescription = Nothing
}
bmStatus :: Lens' BotMetadata (Maybe LexStatus)
bmStatus = lens _bmStatus (\ s a -> s{_bmStatus = a})
bmCreatedDate :: Lens' BotMetadata (Maybe UTCTime)
bmCreatedDate = lens _bmCreatedDate (\ s a -> s{_bmCreatedDate = a}) . mapping _Time
bmName :: Lens' BotMetadata (Maybe Text)
bmName = lens _bmName (\ s a -> s{_bmName = a})
bmVersion :: Lens' BotMetadata (Maybe Text)
bmVersion = lens _bmVersion (\ s a -> s{_bmVersion = a})
bmLastUpdatedDate :: Lens' BotMetadata (Maybe UTCTime)
bmLastUpdatedDate = lens _bmLastUpdatedDate (\ s a -> s{_bmLastUpdatedDate = a}) . mapping _Time
bmDescription :: Lens' BotMetadata (Maybe Text)
bmDescription = lens _bmDescription (\ s a -> s{_bmDescription = a})
instance FromJSON BotMetadata where
parseJSON
= withObject "BotMetadata"
(\ x ->
BotMetadata' <$>
(x .:? "status") <*> (x .:? "createdDate") <*>
(x .:? "name")
<*> (x .:? "version")
<*> (x .:? "lastUpdatedDate")
<*> (x .:? "description"))
instance Hashable BotMetadata where
instance NFData BotMetadata where
data BuiltinIntentMetadata = BuiltinIntentMetadata'
{ _bimSignature :: !(Maybe Text)
, _bimSupportedLocales :: !(Maybe [Locale])
} deriving (Eq, Read, Show, Data, Typeable, Generic)
builtinIntentMetadata
:: BuiltinIntentMetadata
builtinIntentMetadata =
BuiltinIntentMetadata'
{_bimSignature = Nothing, _bimSupportedLocales = Nothing}
bimSignature :: Lens' BuiltinIntentMetadata (Maybe Text)
bimSignature = lens _bimSignature (\ s a -> s{_bimSignature = a})
bimSupportedLocales :: Lens' BuiltinIntentMetadata [Locale]
bimSupportedLocales = lens _bimSupportedLocales (\ s a -> s{_bimSupportedLocales = a}) . _Default . _Coerce
instance FromJSON BuiltinIntentMetadata where
parseJSON
= withObject "BuiltinIntentMetadata"
(\ x ->
BuiltinIntentMetadata' <$>
(x .:? "signature") <*>
(x .:? "supportedLocales" .!= mempty))
instance Hashable BuiltinIntentMetadata where
instance NFData BuiltinIntentMetadata where
newtype BuiltinIntentSlot = BuiltinIntentSlot'
{ _bisName :: Maybe Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
builtinIntentSlot
:: BuiltinIntentSlot
builtinIntentSlot = BuiltinIntentSlot' {_bisName = Nothing}
bisName :: Lens' BuiltinIntentSlot (Maybe Text)
bisName = lens _bisName (\ s a -> s{_bisName = a})
instance FromJSON BuiltinIntentSlot where
parseJSON
= withObject "BuiltinIntentSlot"
(\ x -> BuiltinIntentSlot' <$> (x .:? "name"))
instance Hashable BuiltinIntentSlot where
instance NFData BuiltinIntentSlot where
data BuiltinSlotTypeMetadata = BuiltinSlotTypeMetadata'
{ _bstmSignature :: !(Maybe Text)
, _bstmSupportedLocales :: !(Maybe [Locale])
} deriving (Eq, Read, Show, Data, Typeable, Generic)
builtinSlotTypeMetadata
:: BuiltinSlotTypeMetadata
builtinSlotTypeMetadata =
BuiltinSlotTypeMetadata'
{_bstmSignature = Nothing, _bstmSupportedLocales = Nothing}
bstmSignature :: Lens' BuiltinSlotTypeMetadata (Maybe Text)
bstmSignature = lens _bstmSignature (\ s a -> s{_bstmSignature = a})
bstmSupportedLocales :: Lens' BuiltinSlotTypeMetadata [Locale]
bstmSupportedLocales = lens _bstmSupportedLocales (\ s a -> s{_bstmSupportedLocales = a}) . _Default . _Coerce
instance FromJSON BuiltinSlotTypeMetadata where
parseJSON
= withObject "BuiltinSlotTypeMetadata"
(\ x ->
BuiltinSlotTypeMetadata' <$>
(x .:? "signature") <*>
(x .:? "supportedLocales" .!= mempty))
instance Hashable BuiltinSlotTypeMetadata where
instance NFData BuiltinSlotTypeMetadata where
data CodeHook = CodeHook'
{ _chUri :: !Text
, _chMessageVersion :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
codeHook
:: Text
-> Text
-> CodeHook
codeHook pUri_ pMessageVersion_ =
CodeHook' {_chUri = pUri_, _chMessageVersion = pMessageVersion_}
chUri :: Lens' CodeHook Text
chUri = lens _chUri (\ s a -> s{_chUri = a})
chMessageVersion :: Lens' CodeHook Text
chMessageVersion = lens _chMessageVersion (\ s a -> s{_chMessageVersion = a})
instance FromJSON CodeHook where
parseJSON
= withObject "CodeHook"
(\ x ->
CodeHook' <$>
(x .: "uri") <*> (x .: "messageVersion"))
instance Hashable CodeHook where
instance NFData CodeHook where
instance ToJSON CodeHook where
toJSON CodeHook'{..}
= object
(catMaybes
[Just ("uri" .= _chUri),
Just ("messageVersion" .= _chMessageVersion)])
data EnumerationValue = EnumerationValue'
{ _evSynonyms :: !(Maybe [Text])
, _evValue :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
enumerationValue
:: Text
-> EnumerationValue
enumerationValue pValue_ =
EnumerationValue' {_evSynonyms = Nothing, _evValue = pValue_}
evSynonyms :: Lens' EnumerationValue [Text]
evSynonyms = lens _evSynonyms (\ s a -> s{_evSynonyms = a}) . _Default . _Coerce
evValue :: Lens' EnumerationValue Text
evValue = lens _evValue (\ s a -> s{_evValue = a})
instance FromJSON EnumerationValue where
parseJSON
= withObject "EnumerationValue"
(\ x ->
EnumerationValue' <$>
(x .:? "synonyms" .!= mempty) <*> (x .: "value"))
instance Hashable EnumerationValue where
instance NFData EnumerationValue where
instance ToJSON EnumerationValue where
toJSON EnumerationValue'{..}
= object
(catMaybes
[("synonyms" .=) <$> _evSynonyms,
Just ("value" .= _evValue)])
data FollowUpPrompt = FollowUpPrompt'
{ _fupPrompt :: !Prompt
, _fupRejectionStatement :: !Statement
} deriving (Eq, Read, Show, Data, Typeable, Generic)
followUpPrompt
:: Prompt
-> Statement
-> FollowUpPrompt
followUpPrompt pPrompt_ pRejectionStatement_ =
FollowUpPrompt'
{_fupPrompt = pPrompt_, _fupRejectionStatement = pRejectionStatement_}
fupPrompt :: Lens' FollowUpPrompt Prompt
fupPrompt = lens _fupPrompt (\ s a -> s{_fupPrompt = a})
fupRejectionStatement :: Lens' FollowUpPrompt Statement
fupRejectionStatement = lens _fupRejectionStatement (\ s a -> s{_fupRejectionStatement = a})
instance FromJSON FollowUpPrompt where
parseJSON
= withObject "FollowUpPrompt"
(\ x ->
FollowUpPrompt' <$>
(x .: "prompt") <*> (x .: "rejectionStatement"))
instance Hashable FollowUpPrompt where
instance NFData FollowUpPrompt where
instance ToJSON FollowUpPrompt where
toJSON FollowUpPrompt'{..}
= object
(catMaybes
[Just ("prompt" .= _fupPrompt),
Just
("rejectionStatement" .= _fupRejectionStatement)])
data FulfillmentActivity = FulfillmentActivity'
{ _faCodeHook :: !(Maybe CodeHook)
, _faType :: !FulfillmentActivityType
} deriving (Eq, Read, Show, Data, Typeable, Generic)
fulfillmentActivity
:: FulfillmentActivityType
-> FulfillmentActivity
fulfillmentActivity pType_ =
FulfillmentActivity' {_faCodeHook = Nothing, _faType = pType_}
faCodeHook :: Lens' FulfillmentActivity (Maybe CodeHook)
faCodeHook = lens _faCodeHook (\ s a -> s{_faCodeHook = a})
faType :: Lens' FulfillmentActivity FulfillmentActivityType
faType = lens _faType (\ s a -> s{_faType = a})
instance FromJSON FulfillmentActivity where
parseJSON
= withObject "FulfillmentActivity"
(\ x ->
FulfillmentActivity' <$>
(x .:? "codeHook") <*> (x .: "type"))
instance Hashable FulfillmentActivity where
instance NFData FulfillmentActivity where
instance ToJSON FulfillmentActivity where
toJSON FulfillmentActivity'{..}
= object
(catMaybes
[("codeHook" .=) <$> _faCodeHook,
Just ("type" .= _faType)])
data Intent = Intent'
{ _iIntentName :: !Text
, _iIntentVersion :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
intent
:: Text
-> Text
-> Intent
intent pIntentName_ pIntentVersion_ =
Intent' {_iIntentName = pIntentName_, _iIntentVersion = pIntentVersion_}
iIntentName :: Lens' Intent Text
iIntentName = lens _iIntentName (\ s a -> s{_iIntentName = a})
iIntentVersion :: Lens' Intent Text
iIntentVersion = lens _iIntentVersion (\ s a -> s{_iIntentVersion = a})
instance FromJSON Intent where
parseJSON
= withObject "Intent"
(\ x ->
Intent' <$>
(x .: "intentName") <*> (x .: "intentVersion"))
instance Hashable Intent where
instance NFData Intent where
instance ToJSON Intent where
toJSON Intent'{..}
= object
(catMaybes
[Just ("intentName" .= _iIntentName),
Just ("intentVersion" .= _iIntentVersion)])
data IntentMetadata = IntentMetadata'
{ _imCreatedDate :: !(Maybe POSIX)
, _imName :: !(Maybe Text)
, _imVersion :: !(Maybe Text)
, _imLastUpdatedDate :: !(Maybe POSIX)
, _imDescription :: !(Maybe Text)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
intentMetadata
:: IntentMetadata
intentMetadata =
IntentMetadata'
{ _imCreatedDate = Nothing
, _imName = Nothing
, _imVersion = Nothing
, _imLastUpdatedDate = Nothing
, _imDescription = Nothing
}
imCreatedDate :: Lens' IntentMetadata (Maybe UTCTime)
imCreatedDate = lens _imCreatedDate (\ s a -> s{_imCreatedDate = a}) . mapping _Time
imName :: Lens' IntentMetadata (Maybe Text)
imName = lens _imName (\ s a -> s{_imName = a})
imVersion :: Lens' IntentMetadata (Maybe Text)
imVersion = lens _imVersion (\ s a -> s{_imVersion = a})
imLastUpdatedDate :: Lens' IntentMetadata (Maybe UTCTime)
imLastUpdatedDate = lens _imLastUpdatedDate (\ s a -> s{_imLastUpdatedDate = a}) . mapping _Time
imDescription :: Lens' IntentMetadata (Maybe Text)
imDescription = lens _imDescription (\ s a -> s{_imDescription = a})
instance FromJSON IntentMetadata where
parseJSON
= withObject "IntentMetadata"
(\ x ->
IntentMetadata' <$>
(x .:? "createdDate") <*> (x .:? "name") <*>
(x .:? "version")
<*> (x .:? "lastUpdatedDate")
<*> (x .:? "description"))
instance Hashable IntentMetadata where
instance NFData IntentMetadata where
data Message = Message'
{ _mGroupNumber :: !(Maybe Nat)
, _mContentType :: !ContentType
, _mContent :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
message
:: ContentType
-> Text
-> Message
message pContentType_ pContent_ =
Message'
{ _mGroupNumber = Nothing
, _mContentType = pContentType_
, _mContent = pContent_
}
mGroupNumber :: Lens' Message (Maybe Natural)
mGroupNumber = lens _mGroupNumber (\ s a -> s{_mGroupNumber = a}) . mapping _Nat
mContentType :: Lens' Message ContentType
mContentType = lens _mContentType (\ s a -> s{_mContentType = a})
mContent :: Lens' Message Text
mContent = lens _mContent (\ s a -> s{_mContent = a})
instance FromJSON Message where
parseJSON
= withObject "Message"
(\ x ->
Message' <$>
(x .:? "groupNumber") <*> (x .: "contentType") <*>
(x .: "content"))
instance Hashable Message where
instance NFData Message where
instance ToJSON Message where
toJSON Message'{..}
= object
(catMaybes
[("groupNumber" .=) <$> _mGroupNumber,
Just ("contentType" .= _mContentType),
Just ("content" .= _mContent)])
data Prompt = Prompt'
{ _pResponseCard :: !(Maybe Text)
, _pMessages :: !(List1 Message)
, _pMaxAttempts :: !Nat
} deriving (Eq, Read, Show, Data, Typeable, Generic)
prompt
:: NonEmpty Message
-> Natural
-> Prompt
prompt pMessages_ pMaxAttempts_ =
Prompt'
{ _pResponseCard = Nothing
, _pMessages = _List1 # pMessages_
, _pMaxAttempts = _Nat # pMaxAttempts_
}
pResponseCard :: Lens' Prompt (Maybe Text)
pResponseCard = lens _pResponseCard (\ s a -> s{_pResponseCard = a})
pMessages :: Lens' Prompt (NonEmpty Message)
pMessages = lens _pMessages (\ s a -> s{_pMessages = a}) . _List1
pMaxAttempts :: Lens' Prompt Natural
pMaxAttempts = lens _pMaxAttempts (\ s a -> s{_pMaxAttempts = a}) . _Nat
instance FromJSON Prompt where
parseJSON
= withObject "Prompt"
(\ x ->
Prompt' <$>
(x .:? "responseCard") <*> (x .: "messages") <*>
(x .: "maxAttempts"))
instance Hashable Prompt where
instance NFData Prompt where
instance ToJSON Prompt where
toJSON Prompt'{..}
= object
(catMaybes
[("responseCard" .=) <$> _pResponseCard,
Just ("messages" .= _pMessages),
Just ("maxAttempts" .= _pMaxAttempts)])
data Slot = Slot'
{ _sSlotType :: !(Maybe Text)
, _sValueElicitationPrompt :: !(Maybe Prompt)
, _sResponseCard :: !(Maybe Text)
, _sPriority :: !(Maybe Nat)
, _sSlotTypeVersion :: !(Maybe Text)
, _sSampleUtterances :: !(Maybe [Text])
, _sDescription :: !(Maybe Text)
, _sName :: !Text
, _sSlotConstraint :: !SlotConstraint
} deriving (Eq, Read, Show, Data, Typeable, Generic)
slot
:: Text
-> SlotConstraint
-> Slot
slot pName_ pSlotConstraint_ =
Slot'
{ _sSlotType = Nothing
, _sValueElicitationPrompt = Nothing
, _sResponseCard = Nothing
, _sPriority = Nothing
, _sSlotTypeVersion = Nothing
, _sSampleUtterances = Nothing
, _sDescription = Nothing
, _sName = pName_
, _sSlotConstraint = pSlotConstraint_
}
sSlotType :: Lens' Slot (Maybe Text)
sSlotType = lens _sSlotType (\ s a -> s{_sSlotType = a})
sValueElicitationPrompt :: Lens' Slot (Maybe Prompt)
sValueElicitationPrompt = lens _sValueElicitationPrompt (\ s a -> s{_sValueElicitationPrompt = a})
sResponseCard :: Lens' Slot (Maybe Text)
sResponseCard = lens _sResponseCard (\ s a -> s{_sResponseCard = a})
sPriority :: Lens' Slot (Maybe Natural)
sPriority = lens _sPriority (\ s a -> s{_sPriority = a}) . mapping _Nat
sSlotTypeVersion :: Lens' Slot (Maybe Text)
sSlotTypeVersion = lens _sSlotTypeVersion (\ s a -> s{_sSlotTypeVersion = a})
sSampleUtterances :: Lens' Slot [Text]
sSampleUtterances = lens _sSampleUtterances (\ s a -> s{_sSampleUtterances = a}) . _Default . _Coerce
sDescription :: Lens' Slot (Maybe Text)
sDescription = lens _sDescription (\ s a -> s{_sDescription = a})
sName :: Lens' Slot Text
sName = lens _sName (\ s a -> s{_sName = a})
sSlotConstraint :: Lens' Slot SlotConstraint
sSlotConstraint = lens _sSlotConstraint (\ s a -> s{_sSlotConstraint = a})
instance FromJSON Slot where
parseJSON
= withObject "Slot"
(\ x ->
Slot' <$>
(x .:? "slotType") <*>
(x .:? "valueElicitationPrompt")
<*> (x .:? "responseCard")
<*> (x .:? "priority")
<*> (x .:? "slotTypeVersion")
<*> (x .:? "sampleUtterances" .!= mempty)
<*> (x .:? "description")
<*> (x .: "name")
<*> (x .: "slotConstraint"))
instance Hashable Slot where
instance NFData Slot where
instance ToJSON Slot where
toJSON Slot'{..}
= object
(catMaybes
[("slotType" .=) <$> _sSlotType,
("valueElicitationPrompt" .=) <$>
_sValueElicitationPrompt,
("responseCard" .=) <$> _sResponseCard,
("priority" .=) <$> _sPriority,
("slotTypeVersion" .=) <$> _sSlotTypeVersion,
("sampleUtterances" .=) <$> _sSampleUtterances,
("description" .=) <$> _sDescription,
Just ("name" .= _sName),
Just ("slotConstraint" .= _sSlotConstraint)])
data SlotTypeMetadata = SlotTypeMetadata'
{ _stmCreatedDate :: !(Maybe POSIX)
, _stmName :: !(Maybe Text)
, _stmVersion :: !(Maybe Text)
, _stmLastUpdatedDate :: !(Maybe POSIX)
, _stmDescription :: !(Maybe Text)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
slotTypeMetadata
:: SlotTypeMetadata
slotTypeMetadata =
SlotTypeMetadata'
{ _stmCreatedDate = Nothing
, _stmName = Nothing
, _stmVersion = Nothing
, _stmLastUpdatedDate = Nothing
, _stmDescription = Nothing
}
stmCreatedDate :: Lens' SlotTypeMetadata (Maybe UTCTime)
stmCreatedDate = lens _stmCreatedDate (\ s a -> s{_stmCreatedDate = a}) . mapping _Time
stmName :: Lens' SlotTypeMetadata (Maybe Text)
stmName = lens _stmName (\ s a -> s{_stmName = a})
stmVersion :: Lens' SlotTypeMetadata (Maybe Text)
stmVersion = lens _stmVersion (\ s a -> s{_stmVersion = a})
stmLastUpdatedDate :: Lens' SlotTypeMetadata (Maybe UTCTime)
stmLastUpdatedDate = lens _stmLastUpdatedDate (\ s a -> s{_stmLastUpdatedDate = a}) . mapping _Time
stmDescription :: Lens' SlotTypeMetadata (Maybe Text)
stmDescription = lens _stmDescription (\ s a -> s{_stmDescription = a})
instance FromJSON SlotTypeMetadata where
parseJSON
= withObject "SlotTypeMetadata"
(\ x ->
SlotTypeMetadata' <$>
(x .:? "createdDate") <*> (x .:? "name") <*>
(x .:? "version")
<*> (x .:? "lastUpdatedDate")
<*> (x .:? "description"))
instance Hashable SlotTypeMetadata where
instance NFData SlotTypeMetadata where
data Statement = Statement'
{ _staResponseCard :: !(Maybe Text)
, _staMessages :: !(List1 Message)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
statement
:: NonEmpty Message
-> Statement
statement pMessages_ =
Statement' {_staResponseCard = Nothing, _staMessages = _List1 # pMessages_}
staResponseCard :: Lens' Statement (Maybe Text)
staResponseCard = lens _staResponseCard (\ s a -> s{_staResponseCard = a})
staMessages :: Lens' Statement (NonEmpty Message)
staMessages = lens _staMessages (\ s a -> s{_staMessages = a}) . _List1
instance FromJSON Statement where
parseJSON
= withObject "Statement"
(\ x ->
Statement' <$>
(x .:? "responseCard") <*> (x .: "messages"))
instance Hashable Statement where
instance NFData Statement where
instance ToJSON Statement where
toJSON Statement'{..}
= object
(catMaybes
[("responseCard" .=) <$> _staResponseCard,
Just ("messages" .= _staMessages)])
data UtteranceData = UtteranceData'
{ _udFirstUtteredDate :: !(Maybe POSIX)
, _udCount :: !(Maybe Int)
, _udUtteranceString :: !(Maybe Text)
, _udLastUtteredDate :: !(Maybe POSIX)
, _udDistinctUsers :: !(Maybe Int)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
utteranceData
:: UtteranceData
utteranceData =
UtteranceData'
{ _udFirstUtteredDate = Nothing
, _udCount = Nothing
, _udUtteranceString = Nothing
, _udLastUtteredDate = Nothing
, _udDistinctUsers = Nothing
}
udFirstUtteredDate :: Lens' UtteranceData (Maybe UTCTime)
udFirstUtteredDate = lens _udFirstUtteredDate (\ s a -> s{_udFirstUtteredDate = a}) . mapping _Time
udCount :: Lens' UtteranceData (Maybe Int)
udCount = lens _udCount (\ s a -> s{_udCount = a})
udUtteranceString :: Lens' UtteranceData (Maybe Text)
udUtteranceString = lens _udUtteranceString (\ s a -> s{_udUtteranceString = a})
udLastUtteredDate :: Lens' UtteranceData (Maybe UTCTime)
udLastUtteredDate = lens _udLastUtteredDate (\ s a -> s{_udLastUtteredDate = a}) . mapping _Time
udDistinctUsers :: Lens' UtteranceData (Maybe Int)
udDistinctUsers = lens _udDistinctUsers (\ s a -> s{_udDistinctUsers = a})
instance FromJSON UtteranceData where
parseJSON
= withObject "UtteranceData"
(\ x ->
UtteranceData' <$>
(x .:? "firstUtteredDate") <*> (x .:? "count") <*>
(x .:? "utteranceString")
<*> (x .:? "lastUtteredDate")
<*> (x .:? "distinctUsers"))
instance Hashable UtteranceData where
instance NFData UtteranceData where
data UtteranceList = UtteranceList'
{ _ulBotVersion :: !(Maybe Text)
, _ulUtterances :: !(Maybe [UtteranceData])
} deriving (Eq, Read, Show, Data, Typeable, Generic)
utteranceList
:: UtteranceList
utteranceList =
UtteranceList' {_ulBotVersion = Nothing, _ulUtterances = Nothing}
ulBotVersion :: Lens' UtteranceList (Maybe Text)
ulBotVersion = lens _ulBotVersion (\ s a -> s{_ulBotVersion = a})
ulUtterances :: Lens' UtteranceList [UtteranceData]
ulUtterances = lens _ulUtterances (\ s a -> s{_ulUtterances = a}) . _Default . _Coerce
instance FromJSON UtteranceList where
parseJSON
= withObject "UtteranceList"
(\ x ->
UtteranceList' <$>
(x .:? "botVersion") <*>
(x .:? "utterances" .!= mempty))
instance Hashable UtteranceList where
instance NFData UtteranceList where